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

Concurrency limit #59

Open
michaelangeloio opened this issue Nov 16, 2024 · 3 comments
Open

Concurrency limit #59

michaelangeloio opened this issue Nov 16, 2024 · 3 comments

Comments

@michaelangeloio
Copy link

Is it possible to set a concurrency limit for a specific queue? Like limit concurrency per user ID?

@markuswustenberg
Copy link
Member

@michaelangeloio the queue isn't really concerned with how you consume it, that's on the consumer side.

If you mean within the jobs package, you can set a global concurrent job limit: https://pkg.go.dev/github.com/maragudk/[email protected]/jobs#NewRunnerOpts . But it wouldn't be able to do it based on something like user ID, because there's no concept of user ID in the queue itself.

@michaelangeloio
Copy link
Author

@michaelangeloio the queue isn't really concerned with how you consume it, that's on the consumer side.

If you mean within the jobs package, you can set a global concurrent job limit: https://pkg.go.dev/github.com/maragudk/[email protected]/jobs#NewRunnerOpts . But it wouldn't be able to do it based on something like user ID, because there's no concept of user ID in the queue itself.

@markuswustenberg awesome thank you for responding! Just to clarify, is there anything like a "retry" so that I can rate limit to one job per user at any given time? I have a requirement where only one job can be run for a given user at a time.

@markuswustenberg
Copy link
Member

I guess you could give each user a queue and set the limit to 1. Otherwise, no.

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

2 participants