RE: Example using ffi to wrap poll or epoll.

  • From: William Adams <william_a_adams@xxxxxxx>
  • To: "luajit@xxxxxxxxxxxxx" <luajit@xxxxxxxxxxxxx>
  • Date: Tue, 30 Oct 2012 21:08:01 +0000

I'm working on exactly that.  I'm doing it on the Raspberry Pi, but it's 
generally applicable everywhere I think.
I recently wrote a blog entry (williamaadams.wordpress.com) about IEnumberable 
vs IObservervable, and how that loosely relates to async.  There's a lot to 
tease apart in this, but it's not insurmountable.
Ultimately, you will have "callbacks", but if you plumb it to the bottom using 
Lua, they'll just be simple Lua calls, rather than the morass of callbacks from 
C libraries that you have to go through today.
-- William

===============================
- Shaping clay is easier than digging it out of the ground.

> Date: Tue, 30 Oct 2012 16:02:51 -0500
> Subject: Example using ffi to wrap poll or epoll.
> From: tim@xxxxxxxxxxxxxx
> To: luajit@xxxxxxxxxxxxx
> 
> I've seen Mike mention several times on this list that we shouldn't be
> using callback event loops (like libuv or libev), especially if we
> don't need cross-platform compatibility.  The only reason I use libuv
> for everything is I don't know any better.
> 
> So my question is how do I create a tcp server without these
> libraries?  Is there some example out there that shows how to
> multiplex file I/O, timers, and network events.
> 
> I'm fine if it's linux only, that's about the only platform I develop
> and deploy to (I develop on a linux VM using c9.io from my browser)
> 
> -Tim Caswell
> 
                                          

Other related posts: