Lapis is very dependent on the server backend it is running in, generally OpenResty.
Last I investigated, the ergonomics of the websockets API in OpenResty didn't really seem like a good candidate for building websocket based applications. As an example, there's no trivial way to keep track of all connected clients and broadcast a message to them without overly complicated solutions. It's not trivial to listen to events from different asynchronous sources at the same time. (probably other things too but I don't remember right now) OpenResty/Nginx is not a general purpose event loop. The fact that it's primarily an HTTP webserver is evident in the design of the interfaces that are made available.
That said, there's nothing stopping you from and utilizing the `ngx` APIs directly, there are just a few considerations to be made with database connection pooling, but generally you can `require` any Lapis module and use it anywhere in Lua code. For websockets in OpenResty look here: https://github.com/openresty/lua-resty-websocket
The reason the issue is still open is not because I'm not interested in adding it, but because I didn't feel Lapis could provide a useful abstraction at this time.
This is valuable context behind understanding the issue. I apologise for the unfounded accusation, though in my defence the issue probably could have used this clarification.
In any case, I sympathise with being constrained by design/interface of underlying technology. One one hand, I suspect like most people I lack the knowledge of Nginx internals or its Lua API. But on the other hand, it's cool that one has an escape hatch in terms of being able to leverage other solutions from the underlying platform.
My last two cents on this matter (not a criticism or demand), since the docs are beginner friendly, perhaps a likewise friendly guide on dropping down to `ngx` API for the rare case when such escape hatches are needed (e.g. cookbook for this websocket scenario) could be beneficial for end user, even if the primary focus of Lapis is to enable one to not have to do that.
Last I investigated, the ergonomics of the websockets API in OpenResty didn't really seem like a good candidate for building websocket based applications. As an example, there's no trivial way to keep track of all connected clients and broadcast a message to them without overly complicated solutions. It's not trivial to listen to events from different asynchronous sources at the same time. (probably other things too but I don't remember right now) OpenResty/Nginx is not a general purpose event loop. The fact that it's primarily an HTTP webserver is evident in the design of the interfaces that are made available.
That said, there's nothing stopping you from and utilizing the `ngx` APIs directly, there are just a few considerations to be made with database connection pooling, but generally you can `require` any Lapis module and use it anywhere in Lua code. For websockets in OpenResty look here: https://github.com/openresty/lua-resty-websocket
The reason the issue is still open is not because I'm not interested in adding it, but because I didn't feel Lapis could provide a useful abstraction at this time.