You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Backgrounded factories are invisible.
If your (now backgrounded) factory depends on something in the DI scope, you have no way of preventing the scope from being disposed.
This can lead your factory to fail.
Solution
When backgrounding a task in MaybeBackgroundCompleteTimedOutFactory, would it not be possible to alert something like "hey this task is now running in the background, heads up!".
This would then allow you to prevent the scope from being disposed by doing await fusionCache.WaitForBackgroundedTasks() or something of the sort.
I see a Activities.EventNames.FactoryBackgroundMove event is fired, maybe we can create & add a FusionCacheEventsHub.BackgroundFactoryMove next to it?
Alternatives
None come to mind.
Additional context
I use FusionCache on a web server and I am fine with leaving the scope open for the backgrounded tasks once an HTTP response has been issued.
I imagine putting something in HttpContext.Response.OnCompleted to await the background factories.
The text was updated successfully, but these errors were encountered:
Problem
Backgrounded factories are invisible.
If your (now backgrounded) factory depends on something in the DI scope, you have no way of preventing the scope from being disposed.
This can lead your factory to fail.
Solution
When backgrounding a task in
MaybeBackgroundCompleteTimedOutFactory
, would it not be possible to alert something like "hey this task is now running in the background, heads up!".This would then allow you to prevent the scope from being disposed by doing
await fusionCache.WaitForBackgroundedTasks()
or something of the sort.I see a
Activities.EventNames.FactoryBackgroundMove
event is fired, maybe we can create & add aFusionCacheEventsHub.BackgroundFactoryMove
next to it?Alternatives
None come to mind.
Additional context
I use FusionCache on a web server and I am fine with leaving the scope open for the backgrounded tasks once an HTTP response has been issued.
I imagine putting something in
HttpContext.Response.OnCompleted
to await the background factories.The text was updated successfully, but these errors were encountered: