rough framework
[lemu] / README.md
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..7321bf5
--- /dev/null
+++ b/README.md
@@ -0,0 +1,28 @@
+# LEMU
+
+This is a (work-in-progress) text-based multi-user server engine, utilizing lua, libevent, and a concurrent work queue.
+The intent is for client interaction to be primarily driven by lua scripting, with the server code itself only handling the heavy-lifting of IO, DB, et cetera.
+
+Nota bene: this is currently a toy implementation, as an architecture for the lua-side has yet to be fleshed out, and is being developed by feel, trial, and error.
+
+## Overview
+
+The main thread runs the event loop, which primarily accepts new connections and feeds their line-based inputs into the thread pool for processing.  Connection hostname resolution and signal handling are also in the main thread.
+
+Each connection has its own queue of input.  When a new line of input is added to a connection's queue and there were no other lines already queued, a new job is added to the workqueue to process that connection's input.
+
+The main unresolved issue here is consistent server state-keeping between each worker-thread's lua processor.  The current stopgap solution is that each worker is totally independent and any global changes to the lua state will be queued as a task to update the common state.  The imagined ideal is a lock-enable native lua environment/table which would be shared by all workers.
+
+## File Tour
+
+       bsd_queue.h      - BSD's sys/queue.h, included here because Linux's version is dreadful
+       command.c        - processes user input
+       common.c         - utility functions
+       connections.c    - manage and interact with active clients
+       db.c             - persistent data storage
+       lua_interface.c  - lua bindings to server and connections
+       main.c           - cli
+       notify.c         - logging abstraction
+       server.c         - event loop, network stuff, glues everything together
+    workqueue.c      - concurrent task runner
+