Cizen.Effects.Race (Cizen v0.18.1) View Source
An effect to run a race for the given effects.
Anonymous race
perform %Race{
effects: [
effect1,
effect2
]
}
# If effect2 resolves faster than effect1 with :somevalue,
# the race returns the :somevalue
Named Race
perform %Race{
effects: [
effect1: effect1,
effect2: effect2
]
}
# If effect2 resolves faster than effect1 with :somevalue,
# the race returns the {effect2: :somevalue}