From 5eef1b7a8f883995f22c61f0e03c7f3e56ce84e3 Mon Sep 17 00:00:00 2001 From: Gui Heise Date: Mon, 21 Feb 2022 11:16:22 -0500 Subject: [PATCH] Add worker and listener task --- listener.py | 2 +- worker.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/listener.py b/listener.py index 8c147c1..149d76d 100644 --- a/listener.py +++ b/listener.py @@ -46,7 +46,7 @@ async def run(): broker = connect_broker() export_actor = dramatiq.actor( - export_block_task, + realtime_export_task, broker=broker, queue_name=HIGH_PRIORITY_QUEUE, priority=HIGH_PRIORITY, diff --git a/worker.py b/worker.py index ce852f0..d7e0e10 100644 --- a/worker.py +++ b/worker.py @@ -11,10 +11,13 @@ from mev_inspect.queue.middleware import ( InspectorMiddleware, ) from mev_inspect.queue.tasks import ( + HIGH_PRIORITY, + HIGH_PRIORITY_QUEUE, LOW_PRIORITY, LOW_PRIORITY_QUEUE, - export_block_task, + backfill_export_task, inspect_many_blocks_task, + realtime_export_task, ) logging.basicConfig(stream=sys.stdout, level=logging.INFO) @@ -28,4 +31,9 @@ dramatiq.set_broker(broker) dramatiq.actor( inspect_many_blocks_task, queue_name=LOW_PRIORITY_QUEUE, priority=LOW_PRIORITY ) -dramatiq.actor(export_block_task) +dramatiq.actor( + backfill_export_task, queue_name=LOW_PRIORITY_QUEUE, priority=HIGH_PRIORITY_QUEUE +) +dramatiq.actor( + realtime_export_task, queue_name=HIGH_PRIORITY_QUEUE, priority=HIGH_PRIORITY +)