[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Merging libraries' main loops
- From: Stefan Reich <stefan.reich.maker.of.eye@...>
- Date: Mon, 14 Nov 2011 16:05:59 +0000
Here's a general question. Many Lua libraries define their own "master
loop" that waits for events and processes them.
Verse does this, IupLua does it, Copas does it. And I'm sure many
others do it too.
Question is: If I need two of these libraries at once, how do I
combine their loops?
There should be a general solution for this IMHO.
The underlying question is, what events do the libraries wait on. If
it's all socket select, it should be combinable quite easy. If it's
something else, well... I don't know.
I want to use both IupLua and Verse. How do I do it?
Verse has a step() function and IupLua has timers, so I could call the
Verse step function in an IupLua timer for a first approximation. Not
optimal, timing-wise, probably, but it's a start.