pub fn register_do_subscriber(
shard: Arc<dyn DynShard>,
subscriber_id: SubscriberId,
ws_send: impl Fn(&[u8]) + Send + Sync + 'static,
auth: ShardAuth,
) -> Result<DoSubscriberHandle, String>Expand description
Registers a WebSocket-connected player with a shard running inside a DO.
The caller’s DO fetch handler:
- Accepts the WebSocket upgrade.
- Gets a reference to the shard (held in DO-scoped state).
- Calls this function with the WS send closure and the resolved auth.
Returns a close handler — call it in the DO’s webSocketClose event.