marcoCasamento / Hangfire.Redis.StackExchange

HangFire Redis storage based on original (and now unsupported) Hangfire.Redis but using lovely StackExchange.Redis client
Other
456 stars 109 forks source link

Fix pub/sub subscriptions handling #32

Closed WebApelsin closed 7 years ago

WebApelsin commented 7 years ago

Fixes issue #31

marcoCasamento commented 7 years ago

Thank you @WebApelsin for your PR and the cleaner implementation of the subscription, but who's going to dispose the RedisSubscription ?

WebApelsin commented 7 years ago

It is tied to the RedisStorage instance, so it will live as long as the storage will be alive. In its turn the JobStorage is a singletone and it will be released on the app close.

WebApelsin commented 7 years ago

There is also another option. I could implement an IServerComponent (like FetchedJobsWatcher) who will dispose the subscription on the CancellationToken request. What do you think?

WebApelsin commented 7 years ago

@marcoCasamento I've updated the PR, so the subscription will be explicitly disposed on the server shutdown.