protected override void Dispose(bool explicitDispose) { _publicationFilter = null; _processMessageUserDelegate = null; _onSubscriptionActivationUserDelegate = null; _onSubscriptionDeactivationUserDelegate = null; // base.Dispose(explicitDispose); }
public virtual async Task <ILocalSubscription> SubscribeAsync <TData>(ProcessLocalMessage <TData> process, LocalPublicationFilter <TData> publicationFilter = null, LocalSubscriptionStates subscriptionInitialState = default) { var subscription = default(ILocalSubscription); var subscriber = default(ILocalSubscriber); try { subscriber = new DelegateLocalSubscriber <TData>(process: process, publicationFilter: publicationFilter); subscription = new LocalSubscription(publisher: this, subscriber: subscriber, initialState: LocalSubscriptionStates.OwnsSubscriber | LocalSubscriptionStates.PublisherOwnsSubscription | subscriptionInitialState); return(await SubscribeAsync(subscription : subscription).ConfigureAwait(false)); } catch (Exception exception) { DisposeMany(exception, subscriber, subscription); throw; } }
public DelegateLocalSubscriber( ProcessLocalMessage <TPayload> process, LocalPublicationFilter <TPayload> publicationFilter = default, LocalSubscriptionActivationHandler onSubscriptionActivation = default, LocalSubscriptionDeactivationHandler onSubscriptionDeactivation = default, string aboutInfo = default) : base(aboutInfo : aboutInfo) { // process.EnsureNotNull(nameof(process)); // _processMessageUserDelegate = process; _publicationFilter = publicationFilter; _onSubscriptionActivationUserDelegate = onSubscriptionActivation; _onSubscriptionDeactivationUserDelegate = onSubscriptionDeactivation; }
public Task <ILocalSubscription> SubscribeAsync <TPayload>(ProcessLocalMessage <TPayload> process, LocalSubscriptionStates subscriptionInitialState = default) => InnerPublisher.SubscribeAsync(process: process, state: subscriptionInitialState);
public virtual Task <ILocalSubscription> SubscribeAsync <TPayload>(ProcessLocalMessage <TPayload> process, LocalPublicationFilter <TPayload> publicationFilter = default, LocalSubscriptionStates subscriptionInitialState = default) => InnerPublisher.SubscribeAsync(publicationFilter: publicationFilter, process: process, subscriptionInitialState: subscriptionInitialState);
public virtual Task <ILocalSubscription> SubscribeAsync <TPayload>(ProcessLocalMessage <TPayload> process, LocalPublicationFilter <TPayload> publicationFilter = null) => InnerPublisher.SubscribeAsync(publicationFilter: publicationFilter, process: process);
public virtual Task <ILocalSubscription> SubscribeAsync <TPayload>(ProcessLocalMessage <TPayload> process) => InnerPublisher.SubscribeAsync(process: process);
public Task <ILocalSubscription> SubscribeAsync <TData>(ProcessLocalMessage <TData> processMessage, LocalSubscriptionStates state = default(LocalSubscriptionStates)) => SubscribeAsync(process: processMessage, publicationFilter: null, subscriptionInitialState: state);
public Task <ILocalSubscription> SubscribeAsync <TData>(ProcessLocalMessage <TData> processMessage) => SubscribeAsync(process: processMessage, publicationFilter: null, subscriptionInitialState: LocalSubscriptionStates.None);
public DelegateLocalSubscriber(ProcessLocalMessage <TPayload> processMessage, string aboutInfo = default) : this(publicationFilter : null, process : processMessage, aboutInfo : aboutInfo) { }