bynk.actor.by_on_agent
Error A by actor clause was placed on an agent on call handler, which has no actor.
by names who is calling and has the compiler verify it at the edge of the program: an HTTP request, a queue message, a cron tick. An agent handler is not an edge. It is reached only from a service or another agent, which has already been through its own check, so there is no caller left to verify and the clause would be silently ignored. The compiler refuses it instead of letting it look like protection. Remove the clause, and put the by on the service handler that calls the agent, passing on whatever the agent needs as an argument.
Example
on call bump() -> Effect[Int] by v: Visitor { // ✗ an agent handler has no actor
on call bump() -> Effect[Int] { // ✓ the service in front of it holds the `by`In the Book
See also
- Every code in its category, Actors, on the diagnostic index.
bynk explain bynk.actor.by_on_agentshows the same from the installed toolchain, without a network.