[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: A Batteries API specification (was Re: LuaDEAL - Lua DEad Alive Libraries)
- From: Sean Conner <sean@...>
- Date: Mon, 10 Feb 2020 00:59:05 -0500
It was thus said that the Great Oliver once stated:
> On 09.02.20 00:49, Dibyendu Majumdar wrote:
> > As I mentioned earlier in the chain, libuv's great strength it is used
> > in projects like Node.Js and Julia and therefore really battle tested
> > by large numbers of companies and people. Even if you dislike the
> > framework (and some people might dislike it as it builds objects in C
> > and requires really difficult event driven programming) - it is hard
> > to see how a replacement library could be justified.
> yes, I agree, it's hard to justify, but from from an aesthetic point of view I
> would prefer a solution with several platform specific low level Lua C bindings
> to the platform specific APIs select/IOCP etc. and a complexer Lua library above
> these bindings that does the platform abstraction.
Okay, given the two ways of doing events:
Ask when the operation can start (POSIX)
Ask when the operation is finished (IOCP)
then that means two different event libraries. I'm looking over my own
event framework, and I think I identified the two locations where this
distinction can be made---one for TCP  and one for TLS , and it would
be fairly easy to rework the code for POSIX of IOCP style operations.
The _refill() function exists to read data from the underlying socket, and
_drain() to write data to the underlying socket. So modifying those two,
plus the event handler (the unnamed function being returned) is all that's
required (I suspect). But I have no real way to test this at this time.