Alarm handler for heartbeat cleanup
Broadcasts a message to all connected clients
OptionalexcludeWs: WebSocket = nullEnsures an alarm is set for heartbeat cleanup
Handle incoming HTTP requests.
Gets current user count
OptionalexcludeWs: WebSocket = nullCommon WebSocket upgrade handler
Hook called when a new WebSocket connects.
Hook called when a WebSocket disconnects.
Business logic: update value and notify subscribers.
Common close/error handlers
Custom message handler.
Durable Object implementation for a real-time Counter. Extends BaseDurableObject to reuse WebSocket logic.