Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: multiple batches of work in one queue #3

Open
svdo opened this issue Jun 14, 2024 · 0 comments
Open

New feature: multiple batches of work in one queue #3

svdo opened this issue Jun 14, 2024 · 0 comments

Comments

@svdo
Copy link

svdo commented Jun 14, 2024

Thanks for yoltq, this is a great library!

We want to propose an extension of the library, namely adding the concept of batches of work inside a queue. A batch of work is a grouping of jobs that all need the same processing (hence are in the same queue), but has its own status and progress.

Let's try to give an example. Let's say you implement a server that can do image processing on a large number of images. So users can upload any number of images, and then have them processed by the server. This can be done by multiple users at the same time, but the work that needs to be done is the same for each user. And also you don't know how many users there will be. So it is easiest to have one single queue for this, but how does each user then know that the progress is of their images? With this batch concept, each user would have their own batch and there would be an API to get the progress (stats) of a batch.

Specifically, we are proposing:

  1. Defining a new option batch-name for the yoltq/put function (besides depends-on and id). This option then gets stored in the database in a new attribute :com.github.ivarref.yoltq/batch-name. Similar to the queue name, the batch name would be a keyword (or do you think a string would make more sense?)
  2. Defining a new function batch-stats which returns a filtered version of queue-stats, with the following signature:
    (defn batch-stats [qname batch-name] ...)
    

We are working on this at the moment and would very much appreciate your feedback and thoughts on specific choices.

svdo added a commit to Viduet-EU/yoltq that referenced this issue Jun 14, 2024
@svdo svdo mentioned this issue Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant