race
A race condition can occur between competing snippets, like snippets based on the same environment, or snippets that signal a winning strategy but can also stop executing.
The only conditional-hiding-snippet that does not support race is
hide-if-canvas-contains.
The only behavioral-snippet that supports race isskip-video.
Parameters
|
Name |
Description |
Mandatory |
|---|---|---|
|
|
Begins a race, passing an arbitrary amount of winners (default: 1). |
Yes |
|
|
Stops a race. |
Yes |
Filter examples
example.com#$#race start; snippet 1 2 3; other 4 5 6; another 7 8 9; race stop;
example.com#$#race start 2; first 1; second 2; third 3; fourth 4; race stop;
A snippet wins the race, and all others are flagged as losers. A registered callback to stop losing snippets from executing is then invoked.