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
Tasks can force foreground execution in the LocalDispatcher #927
Comments
Do you think there's a benefit to this being a user-facing option? I've been trying to think of use cases outside of a hosted app, and struggled a little bit. The best I can come up with is if you know that you have some tasks which could execute much more quickly in the foreground, because they're already in the cache, whereas they'd have to be recomputed if done in the background. In the use case that motivates this, would we ever want the user to turn |
I'll have a think about it, though I think your user-knows-whats-quicker example is a pretty good one. On the particular nodes we're talking about in the hosted app, I'd imagine they'd either hide or lock it since it needs to be True. |
Regarding the 3rd tick box "Any node with The simplest implementation of this isn't ideal. My idea was to look at the Do you have any ideas regarding this? Did I even explain that in a way that makes sense to anyone but me? |
Yeah, it's almost like you need some sort of tree representation, so as you walk the tree from the root you can turn on the "executeInForeground" flag when you hit one of those nodes, and that flag is then on for any requirements that you subsequently recurse to. I wonder if we have a design for some sort of tree of batches of tasks knocking around anywhere? |
Hardee-har-har. I guess I'll get on that redesign then... |
…ching. Each ExecutableNode has an executeInForeground plug in the Local section of the Dispatcher plugs. This is used by the LocalDispatcher to determine when it's safe to start dispatching from a background thread (if the executeInBackground plug is on in the first place). Fixes GafferHQ#927.
Now that
LocalDispatcher
has anexecuteInBackground
option, some of the tasks may need to force foreground execution (things that need doing on the main thread of the live app for example).LocalDispatcher
should add anexecuteInForeground
plug toExecutableNodes
duringsetupPlugs()
, which overrides it's ownexecuteInBackground
plug.ExecutableNode::execute()
directly rather than thegaffer execute
app.executeInForeground
on forces all of its requirements to execute in the foreground as well.ExecutableNode::execute()
directly whenexecuteInBackground
is off.The text was updated successfully, but these errors were encountered: