Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Child run contexts #8044
Describe the Enhancement:
Please give access to children runcontext from parent runcontexts.
In a report handler, when walking
Describe the Need:
We want to be able to log and report on what resources were fired during a run, their timing, etc. but currently we only get that for the root context.
A potential work around (thanks to @jonlives) WOULD be enabling file-based datacollector, then later parsing that file, and later parsing that file, except the DataCollector is littered with
Can We Help You Implement This?:
so it is easy enough to shove all the child run_contexts into an array off of the run_context.
the next step though is that what you really want is to iterate recursively through all the resource_collections to find resources. there really needs to be a stable API to iterate through the meta-resource_collection and visit every resource, or find every file resource, etc...
i almost wonder if we should wire up the resource collections with parent and child pointers and put the API there. i'm not sure jamming it into the run_context is the best place (because then there's a duplication of concerns), and not sure creating a meta resource_collection object or module is the best idea (again, duplication of concerns). i don't entirely like wiring up pointers across the run_context and the resource_collection because that feels like some duplication as well. i need to noodle on it a bit more...
So I think that assuming the only thing people care about is resource_collection is probably short-sighted.
Wiring up run context seems correct. For example I have code that does stuff like look for queued notifications in the current context, then goes to the parent, repeats until it hits the root.
I think we need another ticket.
"We want to be able to log and report on what resources were fired during a run, their timing, etc. but currently we only get that for the root context."
That task I now think boils down to "fix and generalize the code in the ResourceReporter (and rip out half of the DataCollector as well)" which now looks like it has nothing to do with child run_contexts and is all about hooking the event API.