Skip to content
Playground(another site)

bynk.within.in_agent_handler

Error e.within(d) was used in an agent handler, which has no execution context to hand the abandoned effect to.

within hands the effect it abandons on a timeout to the execution context, and an agent handler has none. Call it from the service handler that calls the agent, so the agent's work is bounded from outside. For a slow call out, FetchOptions.timeout bounds it inside the agent. The same rule holds for bynk.race.in_agent_handler.

Example

agent Feed {
key id: String
on call quote() -> Effect[Result[Int, TimedOut]] {
Slow("a").get().within(1.second) // ✗ an agent handler has no execution context
}
}
service quotes {
on call() -> Effect[Result[Int, TimedOut]] by Caller {
Slow("a").get().within(1.second) // ✓ the service handler has
}
}

In the Book

See also

  • The grammar rule it governs: method_call.
  • Every code in its category, Other, on the diagnostic index.
  • bynk explain bynk.within.in_agent_handler shows the same from the installed toolchain, without a network.