Fifo.lua 0.2 Released

Fifo.lua 0.2 Released

Today I’m releasing verion 0.2 of “fifo.lua”. A lua library that provides a fifo of lua objects.

Changes since 0.1

  • :setempty now returns the fifo so that initialisation is simplified
  • :peek returns 2nd value indicating if there was a value at the given index
  • Remove undocumented :iter and :foreach methods
  • Added __len metamethod as alias for :length method (only available in 5.2+)
  • Fixed bug in :remove method where the last element could not be removed
  • Stricter argument checking
  • Move documentation out of README into a pandoc compatible markdown file
  • Dropped Lua 5.0 support
  • Improved performance (especially in LuaJIT)

daurnimator/lua-http

daurnimator/lua-http

Over 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.

daurnimator/multi-protocol.lua

daurnimator/multi-protocol.lua

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’).