Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to put MQTT client into a subsidiary thread #7

Open
rpgoldman opened this issue Jun 5, 2023 · 0 comments
Open

Unable to put MQTT client into a subsidiary thread #7

rpgoldman opened this issue Jun 5, 2023 · 0 comments

Comments

@rpgoldman
Copy link

I have some code that successfully subscribes to an MQTT broker, and that logs messages to the screen, using as:start-event-loop.

But since this takes over everything, I wanted to run the event loop in a secondary thread. I put the call to as:start-event-loop into a call to bordeaux-threads:make-thread. But now, when I try to run that code, I get a constant stream of warning messages like this:

WARNING:
   MQTT error: Timed out writing message: #S(CL-MQTT::MQTT-MESSAGE
                                             :FIXED-HEADER 192
                                             :PROTOCOL-NAME ""
                                             :PROTOCOL-LEVEL 0
                                             :CONNECT-FLAGS 0
                                             :CONNECT-KEEPALIVE 0
                                             :RET-CODE-RAW 0
                                             :CLIENT-ID ""
                                             :MID 0
                                             :TOPIC ""
                                             :WILL-TOPIC ""
                                             :WILL-MESSAGE ""
                                             :USERNAME ""
                                             :PASSWORD ""
                                             :PAYLOAD #()
                                             :SUBSCRIPTION-QOS-RAW 0)

and no logging messages are ever printed. My understanding is that it should be possible to run the cl-async event loop in a thread. I don't understand what it is about an MQTT client that would make running in a thread different from running in the main process. It seems that somehow a timeout is being triggered, but the client code does not set a timeout anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant