Re: Xcb luajit bindings exist?

  • From: Daurnimator <quae@xxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Mon, 24 Aug 2015 14:29:39 +1000

On 24 August 2015 at 00:33, Cosmin Apreutesei
<cosmin.apreutesei@xxxxxxxxx> wrote:

Well, I don't see why all of that can't be user-provided hooks. You
can multiplex multiple streams over read() and write() just fine.

Only if you provide the correct locking (assuming 'read' and 'write'
are nonblocking varieties that yield() when they get EAGAIN).

you
can provide hooks for TLS that diff. TLS libs could fill, you can call
a user's shutdown(), flush() and even connect(some_data) for TFO --
again all these are optional and you can have a solid http library
even if the user doesn't provide implementations for any of these
except read() and write() and maybe close().

Perhaps l already have what you want....
The http.h1_connection constructor takes a socket object as an
argument:
https://github.com/daurnimator/lua-http/blob/9a89f553086fab58c0384bfff49630074a9a35c5/http/h1_connection.lua#L28
You don't **have** to provide a cqueues based socket, but you should
provide one with a certain subset of methods with the same semantics.

Also, I think HTTP1 and
HTTP2 should be different libs as they have little in common.

From the perspective of a user/developer, they are (and should be:
that is the way it's designed.)
e.g. for a client: they just get a URI with a 'http' scheme, and they
want to retrieve the resource.
for a server: you often have something that generates a http response;
and it shouldn't care whether the client is connecting over http1 or
http2.
(HTTP2 really only matters if you want to start doing server push)
A HTTP1.1 connection is a series of request/responses (termed "streams")
A HTTP2 connection can be mostly treated as a collection of streams.
merely the "in series" limitation has been taken away.


In any case, this thread is now thoroughly off the rails; if you want
to chat about this, lets start a new thread?

Other related posts: