![]() The ioloop and its ":run_until_clients()" method (or "n_ioloop(client)" wrapper) is the right thing to do that. ![]() MUDLET TABLE FIND CODETo make the MQTT connection work, something in your code should periodically pull packets from the server and monitor a connection state. I guess my question is: Am i doing it wrong? Can i run the ioloop wihtout it crashing the main thread? Or if i need to run the ioloop manually, is this the correct way to do it, by manually calling _ioloop_iteration() at a fixed interval? Or is there a better way, calling some method that will check the inbound queue, fire the callbacks then exit without looping? I did try to run the client:_ioloop_iteration() at 100ms instead, but then i had masive crashes again. I would have preferred to run it faster though, as the client is "sluggish" when receiving external messages (understandably) with a 1 second period. ![]() Now i can publish, and subscribe to messages in Mudlet. This works ok'ish when i run it at 1 second period. I managed to get past this issue, by not running ioloop, but rather setting up a timer that run the client:_ioloop_iteration() at a fixed interval. If i run the ioloop the way the examples describe, I will basically crash the mudclient as the ioloop is blocking the "main thread" from executing. ![]() And i have almost gotten it to work the way i want it to using luamqtt. I am trying to implement mqtt support into a mudclient (Mudlet) that has lua as its backend script language. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |