icgood / ratchet

Lua library to provide a generic socket control mechanism for large numbers of connections
http://ratchet.icgood.net/
MIT License
27 stars 5 forks source link

Change to new module style #22

Closed daurnimator closed 12 years ago

daurnimator commented 12 years ago

The old lua style of modules: using module() and/or package.seeall has been deprecated; and it is advised to cease using it in lua 5.1 code.

Not only will this make the library more friendly to use from lua 5.1; it will ensure an easy migration to lua 5.2

=> Change rachet's lua based modules to returning a table of their contents => Localise all functions used in each module (that is, do: local assert , setmetatable = assert , setmetatable; local coyield = coroutine.yield )

icgood commented 12 years ago

Good point. I've been reading about changes in 5.2, and they are very significant for this kind of project. My current plan is to start a branch for 5.2 and re-design a lot of my yield logic to take advantage of the new lua_pcallk () family of functions.

icgood commented 12 years ago

New ratchets (0.8.0+) use new module style and require Lua 5.2. Because of significant improvements to C-based coroutine yielding, I did not want to maintain backwards compatibility with 5.1.

daurnimator commented 12 years ago

IMO its important to maintain compatability with luajit.