You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: