question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Priority based requests queue

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

1reaction
mnmkngcommented, Apr 26, 2022

Words of a senior dev 😄 👍

1reaction
gahabeencommented, Apr 26, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found