hogiyogi
Add Oban Job to Workflow if Oban.insert is called from a Workflow context
Hi everyone!
I had an idea and wanted some thoughts on it from anyone interested. What if you could compose Workflows similar to Ecto’s Repo.transaction?
I have found myself wishing that while defining a Workflow I could call a function that calls Oban.insert and instead of it inserting a new Oban Job, it would instead add the Job to the Workflow.
I wanted to play around with it but didn’t know if there were any obvious reasons this wouldn’t work.
Most Liked
sorentwo
Workflows work similarly to Ecto.Multi, where you’re adding jobs with explicit names and workflow options. If you were to do that in a Repo.transaction/1 style, you’d need an alternative to Oban.insert because each job requires a name, at minimum.
You could make this work with a few helper functions, but I don’t think the ergonomics are there.
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










