Add worker and listener task

This commit is contained in:
Gui Heise 2022-02-21 11:16:22 -05:00
parent c6e6d694ec
commit 5eef1b7a8f
2 changed files with 11 additions and 3 deletions

View File

@ -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,

View File

@ -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
)