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