Pipe: ((createDownstreamStrategy) => StrategyFactory)

A Pipe consumes a StrategyFactory and creates a derived StrategyFactory. This provides a useful formalism for chaining strategies, exercising the generic Job signature of StrategyFactory.

The Pipe API having both upstream and downstream StrategyFactory signatures means the caller (which is often another pipe) dictates the Job type of the eventual upstream Strategy, while the pipe itself controls the Job type of the eventual downstream Strategy, (based on the upstream type).

For example, a timeout Pipe or retry Pipe wraps an original Job in a TimeoutJob or RetryJob - adding extra properties and behaviour. Wiring in each strategy therefore changes the downstream job type, leading to strategies having jobs like RetryJob<TimeoutJob<J>> given an original job J.

Type declaration