ngw
Piping Toniq jobs
Hello *, I’m a little confused by how Toniq works.
I can read on the documentation that I can actually use pipelines to queue jobs (GitHub - joakimk/toniq: Simple and reliable background job processing library for Elixir. · GitHub) using the enqueue_to function.
If I try once everything works like a charm, my jobs are enqueued and run. If I try more than once it fails because the second worker receives a different data structure.
I solved with Enum.map, but honestly I’m not in love with my solution:
Enum.map([Service.Macaw.CreationWorker, Service.Gannet.CreationWorker],
fn(worker) -> Toniq.enqueue(worker, service) end)
I would obviously prefer something like:
service
|> Toniq.enqueue_to(Service.Macaw.CreationWorker)
|> Toniq.enqueue_to(Service.Gannet.CreationWorker)
which seems much more idiomatic.
Suggestions?
ngw
First Post!
NobbZ
Perhaps you should file an issue/feature request at toniqs tracker?
But I have to be honest: I think it feels odd to enqueue a single job item to multiple workers. But perhaps I am missing something here, since I do not use Toniq.
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
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance










