Refactor message handling in TwythonStreamer #225

Merged
extesy merged 2 commits from master into master 2013-06-21 07:37:48 -07:00
extesy commented 2013-06-19 13:25:16 -07:00 (Migrated from github.com)

New parameter handlers has a list of message types for which
corresponding handlers should be called. For example, for default message types
['delete', 'limit', 'disconnect'] handlers on_delete, on_limit,
on_disconnect will be invoked if the streamed message has the
corresponding data node. If the handler returns True then more handlers
might be invoked, otherwise message processing stops. Before all
handlers are called, special on_success handler is invoked with the same
logic: continue message processing if True is returned.

This approach maintains backwards compatibility by not breaking any
existing behaviors. Fixes #223.

New parameter `handlers` has a list of message types for which corresponding handlers should be called. For example, for default message types ['delete', 'limit', 'disconnect'] handlers on_delete, on_limit, on_disconnect will be invoked if the streamed message has the corresponding data node. If the handler returns True then more handlers might be invoked, otherwise message processing stops. Before all handlers are called, special on_success handler is invoked with the same logic: continue message processing if True is returned. This approach maintains backwards compatibility by not breaking any existing behaviors. Fixes #223.
extesy commented 2013-06-19 13:27:23 -07:00 (Migrated from github.com)

I think that failed Travis build is caused by bad twitter access tokens because they are encrypted and can only be decrypted under your account.

I think that failed Travis build is caused by bad twitter access tokens because they are encrypted and can only be decrypted under your account.
michaelhelmick commented 2013-06-19 13:34:31 -07:00 (Migrated from github.com)

@extesy Correct. It's a security issue for Travis. I wish there was a way around this :/ I'll take a look at this PR though in a few

@extesy Correct. It's a security issue for Travis. I wish there was a way around this :/ I'll take a look at this PR though in a few
michaelhelmick commented 2013-06-19 14:00:45 -07:00 (Migrated from github.com)

At a first pass, this looks good! I'll look more into it Saturday!

At a first pass, this looks good! I'll look more into it Saturday!
michaelhelmick commented 2013-06-19 16:34:08 -07:00 (Migrated from github.com)

Other than the line I commented on, this all looks good to me!

Other than the line I commented on, this all looks good to me!
michaelhelmick commented 2013-06-21 07:37:42 -07:00 (Migrated from github.com)

I'm going to go ahead and merge, this; everything worked when I pulled a local copy of your fork! Thanks!

I'm going to go ahead and merge, this; everything worked when I pulled a local copy of your fork! Thanks!
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/twython#225
No description provided.