/// <summary> /// Creates a new quoted representation of a subscribable sequence. /// </summary> /// <param name="value">Subscribable sequence to create a quote for.</param> /// <param name="expression">Expression representing the subscribable sequence.</param> /// <param name="policy">Policy used to evaluate the expression.</param> public QuotedSubscribable(ISubscribable <T> value, Expression expression, IExpressionEvaluationPolicy policy) : base(value, expression, policy) { // // WARNING: This constructor gets called during quote instantiation. // }
public ListenerJanitor(ISubscribable <T> subscribable, T subscriber) { UnityEngine.Debug.Assert(subscribable != null, "Subscribable is null"); UnityEngine.Debug.Assert(subscriber != null, "Subscriber is null"); this.subscribable = subscribable; this.subscriber = subscriber; }
public Skip(ISubscribable <TSource> source, int skipCount) { Debug.Assert(source != null); _source = source; _skipCount = skipCount; }
public DefaultIfEmpty(ISubscribable <TSource> source, TSource defaultValue = default) { Debug.Assert(source != null); _source = source; _defaultValue = defaultValue; }
public virtual PartialViewResult Index(ISubscribable subscribe, Guid activityId) { var userId = _intranetMemberService.GetCurrentMemberId(); var subscriber = subscribe.Subscribers.SingleOrDefault(s => s.UserId == userId); return(Index(activityId, subscriber, subscribe.Type)); }
public StartWith(ISubscribable <T> source, params T[] values) { Debug.Assert(source != null); _source = source; _values = values; }
public void AddSubscription(ISubscribable subscribable) { lock (this._subscriptions) { this._subscriptions.Add(subscribable); } }
public BlockDoSubscribable(ISubscribable <T> source, string onNextLockName, string onErrorLockName, string onCompletedLockName) { _source = source; _onNextLockName = onNextLockName; _onErrorLockName = onErrorLockName; _onCompletedLockName = onCompletedLockName; }
public void RemoveSubscription(ISubscribable subscribable) { lock (this._subscriptions) { this._subscriptions.Remove(subscribable); } }
public void OnNext(ISubscribable <TSource> source) { var id = default(ulong); lock (_lock) { id = unchecked (++_latest); _hasLatest = true; } try { var observer = new i(this, id); var subscription = SubscribeInner <TSource>(source, observer); observer.Subscription = subscription; SubscriptionInitializeVisitor.Subscribe(subscription); SubscriptionInitializeVisitor.SetContext(subscription, _context); _innerSubscription.Subscription = subscription; SubscriptionInitializeVisitor.Start(subscription); } catch (Exception ex) { lock (_lock) { Output.OnError(ex); Dispose(); } } }
public static ListenerJanitor <T> NewAndActivate(ISubscribable <T> subscribable, T subscriber) { ListenerJanitor <T> okd = new ListenerJanitor <T>(subscribable, subscriber); okd.Active = true; return(okd); }
public SelectMany(ISubscribable <TSource> source, Func <TSource, ISubscribable <TCollection> > collectionSelector, Func <TSource, TCollection, TResult> resultSelector) { _source = source; _collectionSelector = collectionSelector; _resultSelector = resultSelector; }
public SingleAsync(ISubscribable <TSource> source, Func <TSource, bool> predicate, bool throwOnEmpty) { Debug.Assert(source != null); _source = source; _predicate = predicate ?? (_ => true); _throwOnEmpty = throwOnEmpty; }
public Sample(ISubscribable <TSource> source, ISubscribable <TSample> sampler) { Debug.Assert(source != null); Debug.Assert(sampler != null); _source = source; _sampler = sampler; }
public Take(ISubscribable <TResult> source, int count) { Debug.Assert(source != null); Debug.Assert(count > 0); _source = source; _count = count; }
public TakeWhileIndexed(ISubscribable <TSource> source, Func <TSource, int, bool> indexPredicate) { Debug.Assert(source != null); Debug.Assert(indexPredicate != null); _source = source; _indexPredicate = indexPredicate; }
public TakeWhile(ISubscribable <TSource> source, Func <TSource, bool> predicate) { Debug.Assert(source != null); Debug.Assert(predicate != null); _source = source; _predicate = predicate; }
public WhereIndexed(ISubscribable <TResult> source, Func <TResult, int, bool> indexPredicate) { Debug.Assert(source != null); Debug.Assert(indexPredicate != null); _source = source; _indexPredicate = indexPredicate; }
public Where(ISubscribable <TResult> source, Func <TResult, bool> predicate) { Debug.Assert(source != null); Debug.Assert(predicate != null); _source = source; _predicate = predicate; }
public TakeUntil(ISubscribable <TSource> source, ISubscribable <TOther> other) { Debug.Assert(source != null); Debug.Assert(other != null); _source = source; _other = other; }
public SelectIndexed(ISubscribable <TSource> source, Func <TSource, int, TResult> selector) { Debug.Assert(source != null); Debug.Assert(selector != null); _source = source; _indexSelector = selector; }
protected DelegateSubscription(TDelegate delegateToExecute, ISubscribable <TArg1, TArg2> attachedProvider) : base(attachedProvider) { if (delegateToExecute == null) { throw new ArgumentNullException(nameof(delegateToExecute)); } this.delegateToExecute = delegateToExecute; }
public void Unsubscribe(ISubscribable subscribable) { if (!_listeners.Contains(subscribable)) { throw new InvalidOperationException(); } _listeners.Remove(subscribable); }
/// <summary> /// Subscription cleanup operator. This operator should only be injected in the final position before a Subscribe call /// in order to defer cleanup until completion of the entire query. /// </summary> /// <typeparam name="T">Type of the elements processed by the operator.</typeparam> /// <param name="source">Sequence to provide subscription cleanup for.</param> /// <returns>Sequence with the subscription cleanup operator applied.</returns> public static ISubscribable <T> CleanupSubscription <T>(this ISubscribable <T> source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } return(new SubscriptionCleanup <T>(source)); }
public SkipUntil(ISubscribable <TSource> source, ISubscribable <TOther> other, bool terminateEarly = false) { Debug.Assert(source != null); Debug.Assert(other != null); _source = source; _other = other; _terminateEarly = terminateEarly; }
public static ISubscribable <Decimal> Sum(this ISubscribable <Decimal> source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } return(new SumDecimal(source)); }
public static ISubscribable <Double?> Sum(this ISubscribable <Double?> source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } return(new SumNullableDouble(source)); }
public static ISubscribable <TSource> SubscribeOnInternalScheduler <TSource>(this ISubscribable <TSource> source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } return(new SubscribableOnScheduler <TSource>(source)); }
public static IPartitionableSubscribable <T> ToPartitionableSubscribable <T>(this ISubscribable <T> source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } return(new SimplePartitionableSubscribable <T>(source)); }
public static ISubscribable <Int32> Sum(this ISubscribable <Int32> source) { if (source == null) { throw new ArgumentNullException(nameof(source)); } return(new SumInt32(source)); }
public void Subscribe(ISubscribable entity) { createEntities.Enqueue(entity); entity.SubscribedBy.Add(Session); }
public void UnSubscribe(ISubscribable entity) { updateEntities.Remove(entity); removeEntities.Enqueue(entity); entity.SubscribedBy.Remove(Session); }