lua-users home
lua-l archive

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

gary ng wrote:
However, PA has a point that while the coroutines are
properly multi-plexed in terms of socket io, the other
IOs are not. Say for example, if I have a SQL related

for me, the problem could be solved if there was a single well-accepted 'select()' kind of routine for anything that could block. this way, you could have a single point of waiting.

Ketmar's proposal seems to be making SQL queries depend on LuaSocket's select(); either writing a separate process to block on SQL and communicate via sockets, or doing the whole SQL TCP client in Lua

when i found myself on these train of thought, i suggested to write a simple module to manage only waiting, and make it easy to write any kind of module to use that single wait.

since i couldn't find any general-enough asyncIO library, i settled on the concept of helper threads, which resulted on HTT (Helper Threads Toolkit). i included as examples TCP and file I/O, with a simple (and short) coroutine scheduler.

the biggest downside is that it uses threads, and not everybody likes it