Add support for listening on multiple streams on the same bot in parallel #8

Merged
CSDUMMI merged 2 commits from feat-multiple-streams into main 2023-04-11 16:55:23 +00:00
CSDUMMI commented 2023-04-03 18:12:23 +00:00 (Migrated from gitlab.com)

Only one listener can be configured per stream.

Streams are added by:


bot.add_stream(Stream.LOCAL)

If the stream requires additional parameters (e.g. a hashtag for the Stream.HASHTAG) these can be provided as positional or keyword arguments to add_stream and will be forwarded to Mastodon.py.

If there are multiple streams, all but the last stream will be run async. The last stream will be run async if run is called with run_async=True.

The add_stream function has a docstring.

!7 contains more extensive examples of the new feature.

Only one listener can be configured per stream. Streams are added by: ```python bot.add_stream(Stream.LOCAL) ``` If the stream requires additional parameters (e.g. a hashtag for the Stream.HASHTAG) these can be provided as positional or keyword arguments to add_stream and will be forwarded to Mastodon.py. If there are multiple streams, all but the last stream will be run async. The last stream will be run async if `run` is called with `run_async=True`. The `add_stream` function has a docstring. !7 contains more extensive examples of the new feature.
CSDUMMI commented 2023-04-03 18:12:23 +00:00 (Migrated from gitlab.com)

requested review from @emacsen

requested review from @emacsen
CSDUMMI commented 2023-04-03 18:12:23 +00:00 (Migrated from gitlab.com)

assigned to @CSDUMMI

assigned to @CSDUMMI
CSDUMMI commented 2023-04-03 18:16:49 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 7356f528 - Add listening to multiple streams on the advanced example.

Compare with previous version

added 1 commit <ul><li>7356f528 - Add listening to multiple streams on the advanced example.</li></ul> [Compare with previous version](/babka_net/mastobot/-/merge_requests/6/diffs?diff_id=646199535&start_sha=9e34d9bce09431f9dbb8e07786d50f13e9344d2f)
CSDUMMI commented 2023-04-03 18:17:57 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 3da09cf4 - Add listening to multiple streams on the advanced example.

Compare with previous version

added 1 commit <ul><li>3da09cf4 - Add listening to multiple streams on the advanced example.</li></ul> [Compare with previous version](/babka_net/mastobot/-/merge_requests/6/diffs?diff_id=646200743&start_sha=7356f5287953caba15c990500cf9ab433ba9c1a5)
CSDUMMI commented 2023-04-03 18:24:15 +00:00 (Migrated from gitlab.com)

mentioned in merge request !7

mentioned in merge request !7
CSDUMMI commented 2023-04-03 18:24:46 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
CSDUMMI commented 2023-04-03 18:55:44 +00:00 (Migrated from gitlab.com)

added 1 commit

  • 5e380fb2 - Add listening to multiple streams on the advanced example.

Compare with previous version

added 1 commit <ul><li>5e380fb2 - Add listening to multiple streams on the advanced example.</li></ul> [Compare with previous version](/babka_net/mastobot/-/merge_requests/6/diffs?diff_id=646232583&start_sha=3da09cf40bf0e2cf234a6a67c82e4e80d2823eb9)
emacsen commented 2023-04-11 16:55:22 +00:00 (Migrated from gitlab.com)

mentioned in commit 63277eb26a

mentioned in commit 63277eb26a0e8f2988646320be1e89dc9894ecee
emacsen (Migrated from gitlab.com) merged commit 63277eb26a into main 2023-04-11 16:55:23 +00:00
Sign in to join this conversation.
No reviewers
No labels
bug
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
babka/matzobot!8
No description provided.