Commit Graph

7 Commits

Author SHA1 Message Date
Nathaniel Wesley Filardo 1070466feb Revise fifo{,sock} (#2671)
Fixes to #2650:

- Convert fifosock to returning tables containing ctors
- Improve docs
- Add a missed :on("sent", nil) in the http server
2019-02-17 18:32:16 +00:00
Nathaniel Wesley Filardo dcc1ea2a49 A generic fifo and fifosock wrapper, under telnet and http server (#2650)
* lua_modules/fifo: a generic queue & socket wrapper

One occasionally wants a generic fifo, so here's a plausible
implementation that's reasonably flexible in its usage.

One possible consumer of this is a variant of TerryE's two-level fifo
trick currently in the telnetd example.  Factor that out to fifosock for
more general use.

* lua_examples/telnet: use factored out fifosock

* lua_modules/http: improve implementation

Switch to fifosock for in-order sending and waiting for everything to be
sent before closing.

Fix header callback by moving the invocation of the handler higher

* fifosock: optimistically cork and delay tx

If we just pushed a little bit of data into a fifosock that had idled,
wait a tick (1 ms) before transmitting.  Hopefully, this means that
we let the rest of the system push more data in before we send the first
packet.  But in a high-throughput situation, where we are streaming data
without idling the fifo, there won't be any additional delay and we'll
coalesce during operation as usual.

The fifosocktest mocks up enough of tmr for this to run, but assumes
an arbitrarily slow processor. ;)
2019-02-16 13:51:40 +01:00
Marcel Stör b126c6b2d2 Re-organize documentation
Drop support for localized content, #2213

Restructure some content to match more closely what we have in master, #2542
2019-01-13 22:01:57 +01:00
galjonsfigur ebdfd1ff6a Rename http server Lua module and fix its documentation (#2594) 2018-12-19 12:23:14 +01:00
galjonsfigur f5fcd0d984 Recreate and unify documentation for Lua modules (#2592)
* Recreate and unify documentation for Lua modules

* Fix typos in docs

* Added/modified READMES to link to new documentation
2018-12-16 21:39:43 +01:00
Vladimir Dronnikov 5d62624e08 cleanup http module 2015-01-26 14:36:39 +03:00
Vladimir Dronnikov 93249a52cb http module draft, with example 2015-01-19 20:12:06 +03:00