Lib.AspNetCore.ServerSentEvents icon indicating copy to clipboard operation
Lib.AspNetCore.ServerSentEvents copied to clipboard

Support DI (`OnClientConnected` and `OnClientDisconnected`)

Open billhong-just opened this issue 2 years ago • 0 comments

Problem to solve

Currently, We have to use clientConnectedArgs.Request.HttpContext.RequestServices.GetRequiredService<T>() to get needed services from DI. It's not an intended way.

Proposal

A more ASP.NET Core style DI. Maybe something like jamesmh/coravel did.

It allow us to use DI in jobs we create.

  • https://docs.coravel.net/Invocables/#_1-generating-a-daily-report-and-emailing-to-users image image

References

  • https://github.com/tpeczek/Lib.AspNetCore.ServerSentEvents/issues/4#issuecomment-1145281863
  • https://github.com/jamesmh/coravel

billhong-just avatar Jun 04 '22 06:06 billhong-just