travisf

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

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

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

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

benwilson512

Author of Craft GraphQL APIs in Elixir with Absinthe

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

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New

Other popular topics Top

Qqwy
Original source of discussion: This topic on the Pragmatic Programmers’ Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New

We're in Beta

About us Mission Statement