private ByteString SerializeCumulativeDemand(CumulativeDemand demand) => new Proto.Msg.CumulativeDemand { SeqNr = demand.SeqNr } .ToByteString();
private void TriggerCumulativeDemand() { var i = _receiveBuffer.RemainingCapacity - _localRemainingRequested; if (_partnerRef != null && i > 0) { var addDemand = _requestStrategy.RequestDemand((int)(_receiveBuffer.Used + _localRemainingRequested)); // only if demand has increased we shoot it right away // otherwise it's the same demand level, so it'd be triggered via redelivery anyway if (addDemand > 0) { _localCumulativeDemand += addDemand; _localRemainingRequested += addDemand; var demand = new CumulativeDemand(_localCumulativeDemand); Log.Debug("[{0}] Demanding until [{1}] (+{2})", _stageActorName, _localCumulativeDemand, addDemand); PartnerRef.Tell(demand, Self); ScheduleDemandRedelivery(); } } }