Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ ConsumeAndStoreOneMessageIfAvailable()

bool System.Threading.Tasks.Dataflow.BroadcastBlock< T >.ConsumeAndStoreOneMessageIfAvailable ( )
inlineprivate

Definition at line 810 of file BroadcastBlock.cs.

811 {
812 while (true)
813 {
814 KeyValuePair<ISourceBlock<T>, DataflowMessageHeader> item;
816 {
817 if (!_boundingState.CountIsLessThanBound)
818 {
819 return false;
820 }
821 if (!_boundingState.PostponedMessages.TryPop(out item))
822 {
823 return false;
824 }
825 _boundingState.CurrentCount++;
826 }
827 bool messageConsumed = false;
828 try
829 {
830 T item2 = item.Key.ConsumeMessage(item.Value, this, out messageConsumed);
831 if (messageConsumed)
832 {
834 return true;
835 }
836 }
837 finally
838 {
839 if (!messageConsumed)
840 {
842 {
843 _boundingState.CurrentCount--;
844 }
845 }
846 }
847 }
848 }
readonly BroadcastingSourceCore< T > _source
readonly BoundingStateWithPostponedAndTask< T > _boundingState

References System.Threading.Tasks.Dataflow.BroadcastBlock< T >._boundingState, System.Threading.Tasks.Dataflow.BroadcastBlock< T >._source, System.Threading.Tasks.Dataflow.BroadcastBlock< T >.BroadcastingSourceCore< TOutput >.AddMessage(), System.Threading.Tasks.Dataflow.BroadcastBlock< T >.IncomingLock, and System.item.

Referenced by System.Threading.Tasks.Dataflow.BroadcastBlock< T >.ConsumeMessagesLoopCore().