X-Git-Url: http://git.squeep.com/?p=lemu;a=blobdiff_plain;f=README.md;fp=README.md;h=7321bf5935d32b58aa6d1077e935c3af907ad9a4;hp=0000000000000000000000000000000000000000;hb=3c54afe11e890fc476cc4730226be1c45f8a04cb;hpb=29235d4c1f0b11bd2efcad262eaae70383228293 diff --git a/README.md b/README.md new file mode 100644 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 +