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
inserting the added callback at position zero in the list.
if using multiple RegisterBeforeDispose in a shell scope, it would be useful if you could actually insert a callback at the end of the list, rather than always at the beginning.
We have a number of tasks which need to be deferred till after the session has been disposed (mostly signalr events, which then trigger callbacks to read commited data), but they need to happen in the correct sequence, where inserting them at the start breaks the sequence.
An overload that supported _beforeDispose.Add(callback); would be ideal.
The text was updated successfully, but these errors were encountered:
You can always insert in reverse order, but it doesn't seem necessary to insert at the start in general as the order cannot be guaranteed anyways in regards to multiple call sites.
Let's add a new overload void BeforeDispose(Func<ShellScope, Task> callback, bool last) that will populate a _beforeDisposeLate collection (lazily initialized) with a _beforeDisposeLate.Add call instead. This way we don't break the current behavior, and you can register specifically at the end of everything. Noting that you won't still be able to manage exactly when compared to other callbacks in the same bucket.
We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).
This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.
Describe the bug
ShellScope.RegisterBeforeDispose
currently does thisinserting the added callback at position zero in the list.
if using multiple
RegisterBeforeDispose
in a shell scope, it would be useful if you could actually insert a callback at the end of the list, rather than always at the beginning.We have a number of tasks which need to be deferred till after the session has been disposed (mostly signalr events, which then trigger callbacks to read commited data), but they need to happen in the correct sequence, where inserting them at the start breaks the sequence.
An overload that supported
_beforeDispose.Add(callback);
would be ideal.The text was updated successfully, but these errors were encountered: