/// <inheritdoc/> public void OnSubscribe(ISubscription s) { subscriptions++; if (SubscriptionHelper.SetOnce(ref this.s, s)) { var qs = s as IQueueSubscription <T>; this.qs = qs; if (qs != null) { if (requestFusionMode != FuseableHelper.NONE) { int m = qs.RequestFusion(requestFusionMode); establishedFusionMode = m; if (m == FuseableHelper.SYNC) { try { try { T v; while (qs.Poll(out v)) { values.Add(v); } completions++; Volatile.Write(ref valueCount, values.Count); Volatile.Write(ref lastTimestamp, DateTimeOffset.UtcNow.UtcMillis()); } catch (Exception ex) { errors.Add(ex); } } finally { cde.Signal(); } return; } } } long r = Interlocked.Exchange(ref requested, 0L); if (r != 0L) { s.Request(r); } } }