Github user ahgittin commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/480#discussion_r103499754
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/util/core/task/BasicExecutionContext.java
 ---
    @@ -96,7 +98,50 @@ public ExecutionManager getExecutionManager() {
         /** returns tasks started by this context (or tasks which have all the 
tags on this object) */
         @Override
         public Set<Task<?>> getTasks() { return 
executionManager.getTasksWithAllTags(tags); }
    -     
    +
    +    /** performs execution without spawning a new task thread, though it 
does temporarily set a fake task for the purpose of getting context;
    +     * currently supports suppliers or callables  */
    +    @SuppressWarnings("unchecked")
    +    @Override
    +    public <T> Maybe<T> getImmediately(Object callableOrSupplier) {
    +        BasicTask<?> fakeTaskForContext;
    +        if (callableOrSupplier instanceof BasicTask) {
    +            fakeTaskForContext = (BasicTask<?>)callableOrSupplier;
    --- End diff --
    
    As for the particular code block marked here, it is invoked from 
`ValueResolver` when you supply a `TaskFactory`; `VR` generates the `Task` and 
passes it in with `allowImmediateExecution=true`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to