lua-users home
lua-l archive

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


Hi, all.

I've made an experimental module named "couv".
https://github.com/hnakamur/couv

It's a coroutine based libuv wrapper.
It uses coroutines instead of callbacks (except for Stream:listen(),
Timer:start() and spawn()).

I think the benefits of using coroutines are:
* We can write non-blocking applications which looks like good old
blocking codes wrapped with
  coroutine.wrap().
  Please see a tcp echo server and client example.
  https://github.com/hnakamur/couv/blob/master/examples/tcp-echo-server.lua
  https://github.com/hnakamur/couv/blob/master/examples/tcp-echo-client.lua
* We can use pcall() to catch errors. We don't need to check every
return value for errors.

It is not finished yet and APIs may change.
Currently example and test codes are working, though some tests fail on Windows.

I would like to ask you what do you think about it.

Thanks.

-- 
)Hiroaki Nakamura) hnakamur@gmail.com