Today I’m releasing verion 0.2 of “fifo.lua”. A lua library that provides a fifo of lua objects.
:setemptynow returns the fifo so that initialisation is simplified
:peekreturns 2nd value indicating if there was a value at the given index
__lenmetamethod as alias for
:lengthmethod (only available in 5.2+)
:removemethod where the last element could not be removed
Over the last few weeks, I’ve been working on new lua library in my free time.
It’s a fresh take on a http library for lua. Designed it with HTTP2 in mind from the start, it caters for both clients and servers.
All network operations are non-blocking, yet also work outside of a coroutine. This allows for lua-http to be used in any lua project, application or script.
This snippet demonstrates listening for multiple protocol signatures on the one TCP port. I left off concurrency to make it easier to understand.
The TLS path will only work with the newly commited cqueues
:starttls pushback, which runs userspace buffered data through the incoming
BIO before reading off the socket.
A couple of the protocol patterns I stole from prosody (where a similar idea is done via ‘mod_net_multiplex’).