Stream passed to Oban.insert_all
is materialized twice?
#1189
Labels
area:pro
Related to Oban Pro
closed:duplicate
This is a duplicate issue
kind:bug
Something isn't working
Environment
Current Behavior
Hi! When optimizing some issues we encountered with passing a big list of jobs to
Oban.insert_all
, we thought of using a Stream instead. Oban documentation has this example:Stream.take
returns a lazy Stream, so it suggests that Oban should work nicely all streams here.But when reading the
oban_pro
code I noticed a pattern that suggests the stream would get executed twice. Simplifying a bit, here is roughly the pattern I saw, with some inspect logging added:Expected Behavior
Ideally
Oban.insert_all
wouldn't run the stream passed to it twice. If that's not possible, I would expect this to be documented as a warning.And I'm sorry if I mis-read the code! 🙏🏻
The text was updated successfully, but these errors were encountered: