pubsub icon indicating copy to clipboard operation
pubsub copied to clipboard

Unsubscribe not working

Open mischa71lab opened this issue 4 years ago • 2 comments

Hi,

I am using a static pipelinefactory in a dotnet core webapi. .Exists and Unsubscribe dont seem to be working at all. Everytime i check and unsubscibe in the constructor but it just keeps adding handlers Any idea?


        public DashboardHub(
            //PubSubService pubSubService,
            DashboardsService dashboardsService,
            IPubSubPipelineFactory pubSubPipelineFactory,
            IMemoryCache cache)
        {
            //_pubSubService = pubSubService;
            _dashboardsService = dashboardsService;
            _pubSubPipelineFactory = pubSubPipelineFactory;
            _cache = cache;


            if (_pubSubPipelineFactory.GetSubscriber().Exists<OrderDto>(this, OrderDtoChangedHandler))
            {
                // never hits this spot
            }
            

            if (_pubSubPipelineFactory.GetSubscriber().Exists<OrderDto>(this))
            {
                // never hits this spot
            }

            _pubSubPipelineFactory.GetSubscriber().Subscribe<OrderDto>(this, OrderDtoChangedHandler);
            //works ok

        }

mischa71lab avatar May 29 '20 10:05 mischa71lab

Yes,unsubscribe can't working. me too

Jenuce avatar Jan 11 '21 10:01 Jenuce

I had an issue with unsubscribing to Func<T, Task>.

kevmoens avatar Oct 26 '21 15:10 kevmoens