-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScopeContext - Allow child task to propagate context properties to parent #4643
Comments
I'm interested in something like this as well. I see two issues here. First one is to define the API scope. Both in your sample in in my requirement, we need the API to work in async/await environments, i.e. in a hierarchical tree of execution contexts. That means we must not mix up data from different tasks or threads, and we cannot simply go back until we get to the default root context. So we would likely require an API Second issue is implementation. Usually this "no mixup" means an This would also allow to have nested scopes. In that case, existing scope should be copied. In this end this is allowing control on MDLC snapshots - today they are taken once per value set (which means at least once per context where a value changes), this new API would allow to take the snapshot at will. This could result in:
I am not an nlog committer at all, but I would be interested in creating a PR should someone in the know agree/discuss/amend... my proposition. |
Sounds like we are on the same page, and have recognized the issue with having multiple-child-tasks to the same parent-task, and the issues with concurrency.
Is the same as my
Is the same as my
Sounds great. Notice that |
OK, thanks for the input. I had indeed not seen all the changes in version 5 and would have missed why you were taking about |
Maybe something like this, where it possible to do this:
The properties included in the property-collector should be accessible when using
${scopeproperty}
orIncludeScopeProperties = true
.Guess one could manually inject a ConcurrentDictionary as scope-property at the parent-task-scopecontext, and then child-tasks can resolve that scope-property and insert their own propagating-properties into the ConcurrentDictionary. Thus parent-task-scopecontext will see that the scope-property with ConcurrentDictionary has the propagating-values from the child-tasks.
The text was updated successfully, but these errors were encountered: