use a TaskGroup for mempool notification tasks #94

Merged
jackrobison merged 2 commits from mempool-task-group into master 2022-09-14 18:28:09 +02:00
jackrobison commented 2022-09-13 21:10:21 +02:00 (Migrated from github.com)
No description provided.
moodyjon (Migrated from github.com) reviewed 2022-09-14 18:03:31 +02:00
moodyjon (Migrated from github.com) left a comment

As you noted in coversation, SessionManager._notify_peers() has the same problem. (I see it's dead code at the moment.)

As you noted in coversation, `SessionManager._notify_peers()` has the same problem. (I see it's dead code at the moment.)
moodyjon (Migrated from github.com) commented 2022-09-14 17:57:24 +02:00

LBRYElectrumX has a _task_group member. Have you considered using that?

It requires rework inside session.send_notification() and session.send_history_notifications(), but storing the task in the session would allow cancellation on connection_lost() or other scenarios.

For example: send_notification() creates and stores a task. The task logic is put in _send_notification().

LBRYElectrumX has a `_task_group` member. Have you considered using that? It requires rework inside `session.send_notification()` and `session.send_history_notifications()`, but storing the task in the session would allow cancellation on `connection_lost()` or other scenarios. For example: `send_notification()` creates and stores a task. The task logic is put in `_send_notification()`.
moodyjon (Migrated from github.com) approved these changes 2022-09-14 18:22:17 +02:00
moodyjon (Migrated from github.com) commented 2022-09-14 18:22:10 +02:00

Just for consistency with _send_notification/send_notification, this should be named _send_notifications as it's the non-task-creating version.

Just for consistency with `_send_notification/send_notification`, this should be named `_send_notifications` as it's the non-task-creating version.
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: LBRYCommunity/hub#94
No description provided.