protected override void Dispose(bool explicitDispose) { _publicationFilter = null; _processMessageUserDelegate = null; _onSubscriptionActivationUserDelegate = null; _onSubscriptionDeactivationUserDelegate = null; // base.Dispose(explicitDispose); }
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 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 Task <ILocalSubscription> SubscribeAsync <TData>(ProcessLocalMessage <TData> processMessage, LocalPublicationFilter <TData> publicationFilter) => SubscribeAsync(process: processMessage, publicationFilter: publicationFilter, subscriptionInitialState: LocalSubscriptionStates.None);
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; } }