A place for thoughts, rants and progress reports
Today I’m releasing verion 0.2 of “fifo.lua”. A lua library that provides a fifo of lua objects.
:setempty
now returns the fifo so that initialisation is simplified:peek
returns 2nd value indicating if there was a value at the given index:iter
and :foreach
methods__len
metamethod as alias for :length
method (only available in 5.2+):remove
method where the last element could not be removedOver the last few weeks, I’ve been working on new lua library in my free time.
Announcing: “lua-http”.
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’).