Priority based requests queue
See original GitHub issueDescribe the feature
Add a { priority: number }
parameter when enqueueing a request. I imagine it to be lowest number means higher priority.
Motivation Make sure items are pushed to the dataset as soon as possible.
I’ve got a use case where:
- a run might take 6-12 hours if not a day
- an item pushed to the dataset after a nested list of crawled links
- items have expiring content
- the actor’s user reads the dataset during the run to have the lest freshly pushed items
Right now I’ve got the case where 80 to 100% of these items end up being pushe to the dataset in the last 10% of time of the run, because all links end up treated as last.
Constraints I believe there is no simple drop-in solution with the requestQueue/queueing system as no kind of prioritizing is being done so far so it would require to rethink a little bit the system.
Thoughts?
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (17 by maintainers)
Top Results From Across the Web
Priority Queue pattern - gowie.com
Prioritize requests sent to services so that requests with a higher priority are received and processed more quickly than those with a lower...
Read more >Priority Queue Pattern | Java Design Patterns
Priority Queue enables processing of high priority messages first, regardless of queue size or message age.
Read more >High priority request queue with HAProxy | by Vedran Vučetić
High priority request queue with HAProxy. Load balancers help disperse traffic across a fleet of servers using different algorithms.
Read more >Priority queue - Wikipedia
A priority queue is a concept like a list or a map; just as a list can be implemented with a linked list...
Read more >Priority Queues - Algorithms, 4th Edition
Array representation (unordered). Perhaps the simplest priority queue implementation is based on our code for pushdown stacks. The code for ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Words of a senior dev 😄 👍
@mnmkng It’s in fact mostly in-memory for now (only backing it up to KVS). I’ll see to optimise it at scale when time comes.