internal BlockingSubscriber(int bufferSize, IFlowableSubscriber <T> actual) { this.actual = actual; this.queue = new SpscArrayQueue <T>(bufferSize); this.bufferSize = bufferSize; this.limit = bufferSize - (bufferSize >> 2); }
internal MulticastSubscription(MulticastPublisher <T> parent, IFlowableSubscriber <T> actual, IExecutorWorker worker, int bufferSize) { this.parent = parent; this.actual = actual; this.queue = new SpscArrayQueue <T>(bufferSize); this.worker = worker; this.run = Run; }
internal BlockingLambdaSubscriber(int bufferSize, Action <T> onNext, Action <Exception> onError, Action onComplete) { this.onNext = onNext; this.onError = onError; this.onComplete = onComplete; this.queue = new SpscArrayQueue <T>(bufferSize); this.bufferSize = bufferSize; this.limit = bufferSize - (bufferSize >> 2); }
internal ISimpleQueue <R> GetOrCreateQueue() { ISimpleQueue <R> q = Volatile.Read(ref queue); if (q == null) { q = new SpscArrayQueue <R>(bufferSize); Volatile.Write(ref queue, q); } return(q); }
IQueue <R> GetOrCreateScalarQueue() { var q = Volatile.Read(ref scalarQueue); if (q == null) { if (maxConcurrency == int.MaxValue) { q = new SpscLinkedArrayQueue <R>(prefetch); } else { q = new SpscArrayQueue <R>(maxConcurrency); } Volatile.Write(ref scalarQueue, q); } return(q); }
internal ISimpleQueue <R> GetOrCreateQueue() { var q = Volatile.Read(ref queue); if (q == null) { int pf = prefetch; if (pf == int.MaxValue) { q = new SpscLinkedArrayQueue <R>(Flowable.BufferSize()); } else { q = new SpscArrayQueue <R>(pf); } Volatile.Write(ref queue, q); } return(q); }
internal BlockingEnumeratorSubscriber(int bufferSize) { queue = new SpscArrayQueue <T>(bufferSize); this.bufferSize = bufferSize; this.limit = bufferSize - (bufferSize >> 2); }