trySend method

  1. @override
SendResult trySend(
  1. T value
)
inherited

Implementation

@override
SendResult trySend(T value) {
  if (localSendChannel case final lc?) return lc.trySend(value);
  if (isSendClosed) return const SendErrorDisconnected();

  final t0 = mx.startSendTimer();
  final rc = _ensureConnection();
  if (rc.trySend(value)) {
    mx.trySendOk(t0);
    return const SendOk();
  }
  mx.trySendFail();
  return SendErrorFull();
}