warning actor-cycle
What it means#
A msg may wait for another actor, but if actor A waits for B while B waits for A, neither message can complete (§8.8). The analyzer reports possible cycles as a warning; it is configurable in [lint].
Example#
actor Left {
var right: ActorRef<Right>
msg ping() -> i32 { right.pong() } // <- actor-cycle
}
actor Right {
var left: ActorRef<Left>
msg pong() -> i32 { left.ping() }
}error
actor-cycle
How to fix#
actor Left {
var right: ActorRef<Right>
msg ping() -> i32 { right.pong() }
}
actor Right {
msg pong() -> i32 { 1 }
}Break the cycle: make one direction fire-and-forget (~>), return without waiting, or move the shared logic into a third actor.