コード例 #1
0
		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);
			}
		}
コード例 #3
0
		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
		}
コード例 #4
0
        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
        }