Parallel¶
Parallel CRD provides a way to easily define a list of branches, each receiving the same CloudEvent sent to the Parallel ingress channel. Typically, each branch consists of a filter function guarding the execution of the branch.
Parallel creates Channels and Subscriptions under the hood.
Usage¶
Parallel Spec¶
Parallel has three parts for the Spec:
- branchesdefines the list of- filterand- subscriberpairs, one per branch, and optionally a- replyobject. For each branch:
- (optional) the filteris evaluated and when it returns an event thesubscriberis executed. Bothfilterandsubscribermust beAddressable.
- the event returned by the subscriberis sent to the branchreplyobject. When thereplyis empty, the event is sent to thespec.replyobject.
- (optional) channelTemplatedefines the Template which will be used to createChannels.
- (optional) replydefines where the result of each branch is sent to when the branch does not have its ownreplyobject.
Parallel Status¶
Parallel has three parts for the Status:
- conditionswhich details the overall status of the Parallel object
- ingressChannelStatusand- branchesStatuseswhich convey the status of underlying- Channeland- Subscriptionresource that are created as part of this Parallel.
- addresswhich is exposed so that Parallel can be used where Addressable can be used. Sending to this address will target the- Channelwhich is fronting this Parallel (same as- ingressChannelStatus).
Examples¶
Learn how to use Parallel by following the code samples.