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

How to use in .net core? #36

Closed dotnetshadow closed 7 years ago

dotnetshadow commented 7 years ago

Great work on the project, is there a guide on how to use this library in .net core?

error

I seem to be getting an error where it can't find the method UseRedisStorage()?

Does this work without Pro?

It might be worth having a page where you can show various configuration settings, which I found through closed issues:

GlobalConfiguration.Configuration.UseDashboardMetric( storage.GetDashboardMetricFromRedisInfo("Redis Version", RedisInfoKeys.redis_version) );

dyfilatov commented 7 years ago

Same as .net framework, I guess. public void Configuration(IAppBuilder app) { RedisStorage storage = new RedisStorage("localhost:6379"); GlobalConfiguration .Configuration .Use<JobStorage>(storage, jobStorage => {}) .UseDefaultActivator(); JobStorage.Current = storage; app.UseHangfireDashboard(); app.UseHangfireServer(); }

dotnetshadow commented 7 years ago

Thanks for that, I used this instead not sure if it's better or worse

var storage = new RedisStorage("127.0.0.1:6379", new RedisStorageOptions { Db = 1 }); services.AddHangfire(configuration => configuration.UseStorage(storage));

marcoCasamento commented 7 years ago

Yes, I agree some guide are always useful, also some extension methods as you referred in #39 would be nice too. Let's see if I can arrange something