Hi there,
I currently tried to implement my own dispatcher to implement a exponential backoff timeout to increase the timeout after several retries. After digging into the code some of the parts felt a little off. Maybe I did not understand the concept of the dispatcher completely, but on the other hand this part was not documented very well.
I implemented my ExponentialBackoffTimeoutDispatcher(WebsocketDispatcher). After some testing I found that the dispatcher is wrapped by the WrappedDispatcher. I think I did not understand why this is required. I ran into following troubles:
- The
WrappedDispatcher calls .read without the check_callback parameter. (https://github.com/websocket-client/websocket-client/blob/master/websocket/_app.py#L149)
- The
WrappedDispatcher expects the methods .signal and .abort to be implemented. I have no clue why. (https://github.com/websocket-client/websocket-client/blob/master/websocket/_app.py#L141)
I have the feeling that implementing a own dispatcher is not very common an this code part got lost in the last years. It could also be possible that I am completely on the wrong path. I have my solution, but it feels kinda wrong.
Either way, this is maybe a bug, missing documentation or a stupid user. You may choose. :-)
Best Regards
Sören
Hi there,
I currently tried to implement my own dispatcher to implement a exponential backoff timeout to increase the timeout after several retries. After digging into the code some of the parts felt a little off. Maybe I did not understand the concept of the dispatcher completely, but on the other hand this part was not documented very well.
I implemented my
ExponentialBackoffTimeoutDispatcher(WebsocketDispatcher). After some testing I found that the dispatcher is wrapped by theWrappedDispatcher. I think I did not understand why this is required. I ran into following troubles:WrappedDispatchercalls.readwithout thecheck_callbackparameter. (https://github.com/websocket-client/websocket-client/blob/master/websocket/_app.py#L149)WrappedDispatcherexpects the methods.signaland.abortto be implemented. I have no clue why. (https://github.com/websocket-client/websocket-client/blob/master/websocket/_app.py#L141)I have the feeling that implementing a own dispatcher is not very common an this code part got lost in the last years. It could also be possible that I am completely on the wrong path. I have my solution, but it feels kinda wrong.
Either way, this is maybe a bug, missing documentation or a stupid user. You may choose. :-)
Best Regards
Sören