public ResubscribeCacheElement(TFilterCriteria criteria, ReactiveActions <TActionArg> actions, IDisposable providerSubscription) { ProviderSubscription = providerSubscription; Criteria = criteria; Actions = actions; }
public ResubscribeCacheElement(TFilterCriteria criteria, ReactiveActions <TActionArg> actions) { ProviderSubscription = null; Criteria = criteria; Actions = actions; CurrentStatus = LiveSubscriptionStatus.Rotten; }
public async Task <IDisposable> Subscribe(TCriteria criteria, ReactiveActions <TActionArgument> actions) { var cacheElement = new ResubscribeCacheElement <TCriteria, TActionArgument>(criteria, actions); cache.Add(cacheElement); await TrySubscribeOnCacheElement(cacheElement).ConfigureAwait(false); return(cacheElement); }
private ReactiveActions BuildTestAsset() { var r = new ReactiveActions(); var d = new ActionTendency((Name)"Speak([speachType])", (Name)"[x]"); d.ActivationCooldown = 2; r.AddActionTendency(d); d = new ActionTendency((Name)"Speak(formal)", (Name)"[x]"); d.ActivationCooldown = 5; r.AddActionTendency(d); return(r); }
public async Task <SubscriptionId> Subscribe(TCriteria criteria, ReactiveActions <TNextArgument> actions) { var idTask = SafeWait(async() => { if (subscriptions.ContainsKey(criteria)) { subscriptions[criteria].IncreaseCounter(); return(subscriptions[criteria].SubscriptionId); } var disposable = await SubscribeInternal(criteria, actions).ConfigureAwait(false); var generatedId = generator.GetNewId(); var virtualSubscription = new VirtualSubscription(generatedId, disposable); subscriptions.Add(criteria, virtualSubscription); return(generatedId); }); var subscriptionId = await idTask.ConfigureAwait(false); return(subscriptionId); }
public Task <IDisposable> Subscribe(TCriteria criteria, ReactiveActions <TNextArg> actions) { return(Subscribe(criteria, actions.NextAction, actions.ErrorAction)); }
public SingleSubscriberInfo(ReactiveActions <TNextArg> actions) { Actions = actions; }
public Task <SubscriptionId> Subscribe(TCriteria criteria, ReactiveActions <TActionArg> actions) { return(Subscribe(criteria, actions.NextAction, actions.ErrorAction)); }