bynk.race.outside_handler
Error a.race(b) was used outside a service handler's body and outside a function (in a provider operation, a WebSocket handler or a test case body), where no execution context exists.
race hands the side that loses to the execution context, which only a service handler's body, or a function's it calls, has. A WebSocket handler, a provider operation and a test case have none. Move the race into a service handler or a function, and have the case call that, stubbing a slow side with stub … after. In an agent handler the rule is bynk.race.in_agent_handler.
Example
let r <- Slow("a").get().race(Slow("b").get()) // ✗ a case has no execution context
let r <- quotes.call() // ✓ the service handler racesIn the Book
See also
- The grammar rule it governs:
method_call. - Every code in its category, Other, on the diagnostic index.
bynk explain bynk.race.outside_handlershows the same from the installed toolchain, without a network.