Skip to content

saucisson/lua-copas-ev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status Join the chat at https://gitter.im/saucisson/lua-copas-ev

Copas using lua-ev

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.

Install

This module is available in luarocks:

    luarocks install copas-ev

Usage

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 ()

Compatibility

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, ...

Test

Tests are written for busted.

  busted test/*.lua

About

Copas using lua-ev

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages