Copas-ev is a reimplementation of copas
using lua-ev. It loses portability,
but gains performance, by using the libev
binding.
The first goal of this module is to be 100% compatible with copas. It only
reimplements the core functionalities in copas.lua
, not the ones in
copas.*
modules. Thus, copas.ev
depends on copas
to be fully usable.
This module is available in luarocks:
luarocks install copas-ev
Everywhere you are using the copas`` module, replace it with
copas.ev`
local copev = require "copas.ev"
If you are using an already existing copas
application, make copas.ev
the default instead of copas
, before any require "copas"
:
copev.make_default ()
The default behavior of copas.ev
should be compatible with copas
.
There is also a slightly incompatible mode, that automatically wraps sockets.
It can be enabled using:
copev.compatibility = false
Moreover, copas.ev
adds some primitives, such as missing functions in socket
wrappers (getpeername
, getsockname
, getstats
), a unix
socket type, ...
Tests are written for busted.
busted test/*.lua