public void OnNext(R element) { if (fusionMode == FusionSupport.NONE) { parent.InnerNext(this, element); } else { parent.Drain(); } }
public void OnSubscribe(ISubscription s) { if (SubscriptionHelper.SetOnce(ref this.s, s)) { var qs = s as IQueueSubscription <R>; if (qs != null) { int m = qs.RequestFusion(FuseableHelper.ANY); if (m == FuseableHelper.SYNC) { fusionMode = m; queue = qs; Volatile.Write(ref done, true); parent.Drain(); } else if (m == FuseableHelper.ASYNC) { fusionMode = m; queue = qs; s.Request(prefetch < 0 ? long.MaxValue : prefetch); return; } } queue = QueueDrainHelper.CreateQueue <R>(prefetch); s.Request(prefetch < 0 ? long.MaxValue : prefetch); } }