Refactor TwythonStreamer.on_success #223
Labels
No labels
Bug
Enhancement
Feature Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: code/twython#223
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Current implementation of TwythonStreamer routes the stream in
on_successhandler to delete/limit/disconnect. There are also base empty implementations of these hooks.The problem is that if you override
on_successyou lose that routing. Workaround to call super() is hacky because it implies exact knowledge of TwythonStreamer source code which is a bad design.I suggest to refactor
on_successrouting out of that function and into the mainwhile self.connectedloop. This way you can override any handler as necessary without breaking the routing behavior and you don't need to know that one (out of 6) hooks is somehow special and does the routing.I can probably create a PR for this issue if you think it's a good idea overall.
Go for it! :)
Sent from my iPhone