2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-11-15 03:48:44 +08:00
asynq/internal/rdb
Pior Bastida 3dbda60333
Improve performance of enqueueing tasks (#946)
* Improve performance of enqueueing tasks

Add an in-memory cache to keep track of all the queues. Use this cache
to avoid sending an SADD since after the first call, that extra network
call isn't necessary.

The cache will expire every 10 secs so for cases where the queue is
deleted from asynq:queues set, it can be added again next time a task is
enqueued to it.

* Use sync.Map to simplify the conditional SADD

* Cleanup queuePublished in RemoveQueue

---------

Co-authored-by: Yousif <753751+yousifh@users.noreply.github.com>
2024-10-30 08:25:35 +03:00
..
benchmark_test.go Rename asynqtest package to testutil 2022-04-11 16:55:43 -07:00
inspect_test.go fix unit test 2023-04-17 22:30:33 -07:00
inspect.go Improve performance of enqueueing tasks (#946) 2024-10-30 08:25:35 +03:00
rdb_test.go Improve performance of enqueueing tasks (#946) 2024-10-30 08:25:35 +03:00
rdb.go Improve performance of enqueueing tasks (#946) 2024-10-30 08:25:35 +03:00