Commit graph

29 commits

Author SHA1 Message Date
379df605c9
fix: Reactor.run!/4 should not return an :ok tuple. 2024-08-12 17:03:27 +12:00
e8ac9a1d90
feat(map): Add the ability to map over elements of a collection inside a reactor. (#123)
* feat(map): Add the ability to map over elements of a collection inside a reactor.

* improvement: throw a more helpful error when a step returns an invalid result.

* fix: automatically pass extra arguments from the map step to nested steps.

They can't be referred to directly because they may be added to the graph
at runtime, and may depend on steps which have been completed and their
results discarded because they have no dependents at that time.

* fix: spurious test failures seemingly caused by `Mimic`.
2024-07-18 21:56:46 +12:00
27a01e7862
improvement!: Use Splode for managing errors. (#97) 2024-03-18 13:05:09 +13:00
37b9eda48e
feat: Add telemetry middleware. (#93)
* improvement: don't incur compile-time dependencies on middleware.

* feat: Add a middleware which emits telemetry events about Reactor.
2024-02-29 09:23:51 +13:00
01fddd19b0
improvement!: Remove hooks and replace with middleware behaviour. (#90)
* improvement!: Remove hooks and replace with middleware behaviour.

* improvement(Middleware): Add `get_process_context/0` and `set_process_context/1` middleware hooks.

* improvement: Add step event callback to middleware.
2024-02-26 16:20:54 +13:00
769825874e
improvement: Move can?/2 and async?/1 into Reactor.Step behaviour. (#87)
Makes it a little bit easier for steps to define their own capabilities at runtime.
2024-02-15 10:55:09 +13:00
012d40e887
improvement: Add ability for steps to decide at runtime whether they should be run asyncronously. (#84) 2024-02-08 12:32:43 +13:00
9aa26b9f3b
feat: Add lifecycle hooks to Reactor (#83)
This will allow user code and extensions to add hook functions to run when the reactor starts, stops, fails, etc.
2024-02-08 11:09:35 +13:00
James Harton
4a57a92ba5
fix: don't deadlock when lots of async reactors are sharing a concurrency pool. (#36) 2023-09-28 11:08:47 +13:00
James Harton
f67173b76f
feat: Add collect step entity. (#53)
This change introduces the `collect` step entity to the DSL. It is simply a wrapper around `Reactor.Step.ReturnAllArguments`, but provides the convenience of being able to group together arguments into a single structure for passing into other steps.
2023-09-11 11:58:29 +12:00
9a2738f98b
chore: update to Erlang 26 and Elixir 1.15.5. 2023-09-01 13:24:12 +12:00
James Harton
a9dd4c5c22
fix: Don't swallow errors when a step runs out of retries. (#41)
When a step runs out of retry attempts we either use the error supplied, or synthesise a new one.
2023-07-27 13:26:54 +12:00
James Harton
aa670a4a64
improvement: Add wait_for DSL. (#39) 2023-07-25 10:50:01 +12:00
James Harton
dd75458c76
improvement: Add "subpaths" to templates. (#31) 2023-07-12 07:36:06 +12:00
James Harton
be35183998
improvement(Step.Debug): Add debug step and DSL. (#30) 2023-07-11 12:04:01 +12:00
James Harton
4224aeb23c
improvement(Step.Switch): Add switch DSL and step type. (#29) 2023-07-11 07:20:51 +12:00
James Harton
efc7cb4a91
improvement: Add group DSL entity and Reactor.Step.Group. (#27) 2023-07-04 09:37:53 +12:00
James Harton
b985126894
improvement(Reactor.Executor): track concurrent process usage across multiple reactors. (#26) 2023-06-23 12:29:27 +12:00
James Harton
749e399c02
feat(Step.Around): Add ability to wrap a function around a group of steps. (#24) 2023-06-23 09:09:42 +12:00
027cf03fb8
perf(Dsl): Build and pre-plan DSL reactors. 2023-06-20 14:09:09 +12:00
James Harton
611bf314f0
improvement: Support timeout and async? Reactor options. (#20) 2023-06-16 16:16:40 +12:00
James Harton
614e6725e2
improvement: Invert DSL entity building. (#19)
Instead of defining how to do it in `Reactor.Info` for all entities present and future, we use a protocol which entities must implement.  This allows us to support dynamically patched entities in the future without having to change core code.
2023-06-16 15:28:00 +12:00
James Harton
8f0248857a
improvement: Allow entire step behaviour to be defined in the DSL. (#18) 2023-06-16 14:39:29 +12:00
1af160c6b3 improvement: Add ability to compose reactors. 2023-06-15 14:57:32 +12:00
James Harton
8450554c41
improvement(Builder): rename internally generated steps to start with :__reactor__. (#10) 2023-06-08 13:25:11 +12:00
James Harton
b23e5ef688
improvement: Add step-wide argument transforms. (#9)
* improvement: Add step-wide argument transforms.

* docs: add more entity documentation.
2023-06-08 11:40:02 +12:00
James Harton
7b2e469135
improvement(Reactor.Step): remove can?/1 and replace with optional callbacks. (#6) 2023-05-12 15:50:49 +12:00
James Harton
7ac8cce871
feat: implement basic reactor behaviour. (#1) 2023-05-10 16:27:18 +12:00
Zach Daniel
96fd561714 init 2023-04-18 18:23:04 -04:00