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

ensuring regular callbacks to WebSocketApp's on_message() on the same thread #966

Open
gborrageiro opened this issue Jan 8, 2024 · 0 comments

Comments

@gborrageiro
Copy link

Hello,

Is it possible to ensure regular callbacks to WebSocketApp's on_message() and use the same thread that normally hits on_message()?
Adding a callback via threading is easy enough, for example, see https://websocket-client.readthedocs.io/en/latest/threading.html.
However, in the threading example I mention, use of threading.Thread or threading.Timer calls back the method using a different thread.
In my application, I cannot easily utilise a different thread due to a few reasons such as non-concurrent objects and state management.
The particular WebSocket endpoint (url) defined in my WebSocketApp does not update very often, but is the ideal place to drive other logic in my application. Therefore, a regular callback on the same thread would be helpful.

Thanks
Gabriel

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