travisf
Exq difference between enqueue_at and enqueue_in
I’m curious about the differences between enqueue_in and enqueue_at, the Exq docs aren’t too clear on this.
Marked As Solved
ananthakumaran
So, I’m wondering if there is a way to say “run this job anytime you can after a specific time”.
It works exactly as you described. Enqueue_in/at puts the job in a ZSET with scheduled time as the score. When the current time is > the scheduled time, exq will push the job to the end of the queue. The exact time of execution depends on how many jobs are pending in the queue.
That’s a difficult question, I also don’t generally use Exq, I just have one project I maintain that uses it. From what I can tell in the config the concurrency is set to 3 and then job queues each have their own concurrent values set (max is 3).
Concurrency is handled per queue, the global config is just a fallback value to be used if you don’t specify per queue concurrency.
So I’m not sure if we’d be handling 3 jobs at once or 11 (sum of all concurrencies per queue)
it would be the later
Also Liked
benwilson512
I don’t use Exq myself, but the general way these queueing systems is that the job becomes available to a worker at the set time, but then it does still require that there is a worker free to fetch it.
That basically is how it works. At the time, the job becomes available, and it’ll be processed when a worker is free. How many jobs are you trying to handle?
benwilson512
I believe enqueue_at: time means "enqueue this job to run at a specific time time. enqueue_in: interval would mean “enqueue to run interval seconds into the future from now”.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #metaprogramming
- #security
- #hex









