void IObserver<T>.OnNext(T value) {
			if (isDisposed) return;

			if (canPublishValueOnSubscribe) {
				if (distinctUntilChanged && EqualityComparer.Equals(this.latestValue, value)) {
					return;
				}
			}

			canPublishValueOnSubscribe = true;

			// SetValue
			this.latestValue = value;

			// call source.OnNext
			var node = root;

			while (node != null) {
				node.OnNext(value);
				node = node.Next;
			}

			#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
			commonPromise?.InvokeContinuation(ref value);

			if (removablePromises != null) {
				PromiseHelper.TrySetResultAll(removablePromises.Values, value);
			}

			#endif
		}
示例#2
0
		protected void TrySetResult<T>(ReusablePromise<T> promise, AsyncTriggerPromiseDictionary<T> promises, T value) {
			if (promise != null) {
				promise.TrySetResult(value);
			}

			if (promises != null) {
				PromiseHelper.TrySetResultAll(promises.Values, value);
			}
		}
		void RaiseOnNext(ref T value) {
			var node = root;

			while (node != null) {
				node.OnNext(value);
				node = node.Next;
			}

			#if CSHARP_7_OR_LATER || (UNITY_2018_3_OR_NEWER && (NET_STANDARD_2_0 || NET_4_6))
			commonPromise?.InvokeContinuation(ref value);

			if (removablePromises != null) {
				PromiseHelper.TrySetResultAll(removablePromises.Values, value);
			}

			#endif
		}
        void RaiseOnNext(ref T value)
        {
            var node = root;

            while (node != null)
            {
                node.OnNext(value);
                node = node.Next;
            }

#if (CSHARP_7_OR_LATER)
            commonPromise?.InvokeContinuation(ref value);
            if (removablePromises != null)
            {
                PromiseHelper.TrySetResultAll(removablePromises.Values, value);
            }
#endif
        }