connect method
Establishes the real-time connection and completes protocol handshake.
Returns at once when already connected, and joins the attempt in flight when one is running, so it is safe to call from every place that needs the connection.
Implementation
@override
Future<Either<RealtimeFailure, Unit>> connect() async {
if (isConnected) return const Right(unit);
simulateState(RealtimeConnectionState.connecting);
await Future<void>.delayed(Duration.zero);
simulateState(RealtimeConnectionState.connected);
return const Right(unit);
}