lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > For an implementation using timers with a scheduler checkout
> > CopasTimer (available through LuaRocks). It extends Copas with timer
> > capabilities using calculated timeouts (when it calls select, it sets
> > the timeout to the first timer expiring, so it returns upon IO or
> when
> > a timer is due to be executed).
> > Though Copas is essentially a server (waits for incoming
> connections),
> > it's simple to add outgoing connections. I think the method is called
> > addtask() or newtask() or something similar. The Copas documentation
> > (on github, master, not released yet) contains an example I added a
> > while ago. Dunno what you need, but UDP support is also in master,
> not released yet.
> 
> Mmm, sounds great. I would love to see an official Copas release with a
> simple client API and timers. It really shows off the best of Lua's
> potential when it makes asynchronous network programming so trivial.
> 
> Regards,
> Matthew

CopasTimer is an "add on" module for Copas and is available on its own, just uploaded the docs on a gh-pages branch; http://tieske.github.com/CopasTimer/files/copas/timer.html 

Also uploaded the updated docs for Copas with the samples on extra threads on my fork to make them available; check the http://tieske.github.com/copas/manual.html#using section for examples on using UDP and adding outgoing connections.

Thijs