factor-io/factor

Workflow "any" should check async and return as soon as condition is met

Opened this issue · 1 comments

any is implemented to wait for all results before checking the conditions. This means that the execution time is that of the slowest of all events. Instead, it should be implemented to return as soon as the first is done without waiting for the rest. This would change execution time to that of the fastest in the set.

Side Note: In it's current form it is already faster than the concurrent-ruby implementation.

The concurrent-ruby method waits until one event is completed before it starts the execution of the next. In the Factor implementation we start the execution of all first. This means that the concurrent-ruby execution time is the sum of all execution times. The Factor execution time is that of the slowest.