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

sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
LegitStack
I’m hoping you guys can give me some general advice and perhaps code examples if you’re feeling up to it. I’m very interested in Elixir,...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
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
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New
beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> someth...
New
jc00ke
Expanding on this topic: https://forum.elixirforum.net/t/map-typespec-question/19217 Let’s say I have a map with required and optional k...
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
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
sergio
I couldn’t find any guides that worked well with Phoenix 1.6.0 and esbuild. I hope this helps people test the waters and eases you into t...
New
AstonJ
You’re a programmer, so you don’t need spoon feeding with the conventional drivel about “this is an integer.” No. You need to know what’s...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
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
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
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New

We're in Beta

About us Mission Statement