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 Channel
s and Subscription
s under the hood.
Usage
Parallel Spec
Parallel has three parts for the Spec:
branches
defines the list offilter
andsubscriber
pairs, one per branch, and optionally areply
object. For each branch:- (optional) the
filter
is evaluated and when it returns an event thesubscriber
is executed. Bothfilter
andsubscriber
must beAddressable
. - the event returned by the
subscriber
is sent to the branchreply
object. When thereply
is empty, the event is sent to thespec.reply
object. - (optional)
channelTemplate
defines the Template which will be used to createChannel
s. - (optional)
reply
defines where the result of each branch is sent to when the branch does not have its ownreply
object.
Parallel Status
Parallel has three parts for the Status:
conditions
which details the overall status of the Parallel objectingressChannelStatus
andbranchesStatuses
which convey the status of underlyingChannel
andSubscription
resource that are created as part of this Parallel.address
which is exposed so that Parallel can be used where Addressable can be used. Sending to this address will target theChannel
which is fronting this Parallel (same asingressChannelStatus
).
Examples
Learn how to use Parallel by following the code samples.