I did not do this personally, but I know Event Machine supports working with a unix socket. The advantage of an event machine is that you can have code listening on a socket without βinterferingβ with the Sinatra web server. Thus, you can, for example, listen to a socket for some statistics, store these statistics in memory, and then return them to clients by HTTP requests.
And if you are going to EventMachine, I suggest using thin as your web server, which is implemented on top of it so that you do not need to run it manually.
source share