Add worker and listener task
This commit is contained in:
parent
c6e6d694ec
commit
5eef1b7a8f
@ -46,7 +46,7 @@ async def run():
|
|||||||
|
|
||||||
broker = connect_broker()
|
broker = connect_broker()
|
||||||
export_actor = dramatiq.actor(
|
export_actor = dramatiq.actor(
|
||||||
export_block_task,
|
realtime_export_task,
|
||||||
broker=broker,
|
broker=broker,
|
||||||
queue_name=HIGH_PRIORITY_QUEUE,
|
queue_name=HIGH_PRIORITY_QUEUE,
|
||||||
priority=HIGH_PRIORITY,
|
priority=HIGH_PRIORITY,
|
||||||
|
12
worker.py
12
worker.py
@ -11,10 +11,13 @@ from mev_inspect.queue.middleware import (
|
|||||||
InspectorMiddleware,
|
InspectorMiddleware,
|
||||||
)
|
)
|
||||||
from mev_inspect.queue.tasks import (
|
from mev_inspect.queue.tasks import (
|
||||||
|
HIGH_PRIORITY,
|
||||||
|
HIGH_PRIORITY_QUEUE,
|
||||||
LOW_PRIORITY,
|
LOW_PRIORITY,
|
||||||
LOW_PRIORITY_QUEUE,
|
LOW_PRIORITY_QUEUE,
|
||||||
export_block_task,
|
backfill_export_task,
|
||||||
inspect_many_blocks_task,
|
inspect_many_blocks_task,
|
||||||
|
realtime_export_task,
|
||||||
)
|
)
|
||||||
|
|
||||||
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
|
||||||
@ -28,4 +31,9 @@ dramatiq.set_broker(broker)
|
|||||||
dramatiq.actor(
|
dramatiq.actor(
|
||||||
inspect_many_blocks_task, queue_name=LOW_PRIORITY_QUEUE, priority=LOW_PRIORITY
|
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
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user