> The naming of some elements in the C api is a bit misleading. Personally I wish that all wording with "thread"
> would be changed to "coroutine", and the lua_State would be renamed to "executionstack" or something
> more appropriate.
Yes, I totally second that, it's a bit confusing, especially because Lua's thread aren't preemptive.
Thanks for the links, I'll check them if I can't succeed with my current thinking;
> I'm not familiar with Paho, but how is is used? Is the main loop on the C side and are messages passed to Lua
> to be handled with scripting, or is the main loop on the Lua side? Does Paho create the new os threads?
> Do you have control over that behaviour? Does it also generate new Lua states?
It supports several implementations : Java, C, C++ and even a native Lua library which is not finished up to now.
I'm using the C implementation, which has nothing to do with Lua at all.
My project is the following :
- Daemons and my supervision tool are exchanging data using MQTT messaging : the big advantage is it runs in pub/sub model so I can add / remove / modify any part of my network without touching the remaining.
Now, I'm working now on the "home dashboard" part which will plug-in on this network and will display some valuables informations on a screen on my living room.
- Selene embeds Lua as end user scripting language, which will be used to build the final dashboard (has to be done). And to respond to your question, yes, messages are handled in C then passed to Lua part for end user oriented processing.
The main advantage is a clear separation b/w the technical layers and the end user interface itself.
- Laurent