5 ms·
Thanks Mitchell (big fan, btw!). Indeed!https://github.com/hashicorp/vagrant/blob/main/lib/vagrant/action/builder.rb#L15 https://github.com/hashicorp/vagrant/b
by ismaelct 2y ago
Thanks Mitchell (big fan, btw!).
Indeed!https://github.com/hashicorp/vagrant/blob/main/lib/vagrant/action/builder.rb#L15 https://github.com/hashicorp/vagrant/blob/main/lib/vagrant/a...
Yes, it's not a new pattern by any means, and there's many ways to "halt" the pipeline as you say. For example ActiveRecord stops callback chains if any callback throws ":halt".
Other examples are Redis.rb's pipelining API https://github.com/redis/redis-rb?tab=readme-ov-file#pipelining https://github.com/redis/redis-rb?tab=readme-ov-file#pipelin...
Or more generally any builder-style pattern that composes a set of operations for later execution, including again ActiveRecord's query chaining.
In my article I tried to show a specific implementation using the Railway pattern (where the result must only respond to "#continue?() => Boolean")