Disconnect and destroy

disconnect runs the lifecycle callback only · explicit leave destroys the Actor at the Entry Spot

Disconnect and destroy disconnect runs the lifecycle callback only · explicit leave destroys the Actor at the Entry Spot STREAM connection ends (abnormal, -x) notify disconnected lifecycle callback new STREAM connection AuthenticateReq AuthenticateRes JoinGameMsg(RoomId) dispatch to existing room member's handler JoinGameNotify(current GameState) JoinGameNotify LeaveGameMsg dispatch to bound Actor's Room handler Framework moves Actor to Entry Spot Client · Sequence participant Client Play Session · Sequence participant Play Session Session Runtime · Sequence participant Session Runtime Room Spot · Sequence participant Room Spot Entry Spot · Sequence participant Entry Spot

Interleaved self-steps (mermaid self-messages, in arrow order)

  • • After arrow 1 (STREAM ends): F fixes the current binding snapshot.
  • • After arrow 2 (notify callback): R runs the disconnected lifecycle callback; then F cleans up the binding after all notifications finish — both before the reconnect (arrow 3).
  • • Between arrows 4 and 5 (AuthenticateReq/Res): P resolves the existing Actor and binds its exact ActorRef.
  • • After arrow 11 (dispatch to Room handler): R marks the Actor and requests public leave.
  • • After arrow 12 (move to Entry Spot): E destroys the Actor — the terminal step.

Disconnect vs explicit leave

  • • Session Runtime = Framework Session Runtime. The first arrow is a physical STREAM termination (mermaid -x); it doesn't destroy the Actor or change Room membership.
  • • On reconnect, the Play Session finds the existing Actor and binds its exact ActorRef; because the Actor is already a member, JoinGameMsg returns the current GameState without new membership.
  • • LeaveGameMsg is one-way, so send completion doesn't prove destroy; the runner checks the Room leave callback and Entry Spot destruction per Actor. Host and guest each run this leave path.