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

Multi-account support #4

Merged
merged 5 commits into from
Aug 24, 2017
Merged

Multi-account support #4

merged 5 commits into from
Aug 24, 2017

Conversation

iky
Copy link
Owner

@iky iky commented Aug 23, 2017

Ads the ability to run multiple RTM bots - each bot account having its own RTM client loop

self._client.server.rtm_connect()
def connect(self):
for bot_name, client in self.clients.items():
client.server.rtm_connect()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe move within start loop?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, no need for extra method .)

def handle(self, bot_name, event):
for provider in self._providers:
if provider.bot_name == bot_name:
provider.handle_event(event)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be nice later to have stashed the handlers per bot-name (so we don't need to loop)

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, this uses the ProviderCollector providers set, which the mixin takes care of. It's a trade of between simplicity and efficiency. This could be revisited later on, with making the providers a dictionary.

@timbu
Copy link

timbu commented Aug 24, 2017

👍 nice

@iky iky changed the base branch from master to rc0.0.4 August 24, 2017 10:13
@iky iky merged commit a5a04bd into rc0.0.4 Aug 24, 2017
@iky iky deleted the multi-account branch August 24, 2017 10:18
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

Successfully merging this pull request may close these issues.

2 participants