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

lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
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
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement