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

    https://github.com/apache/brooklyn-server/pull/853#discussion_r142933380
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/util/core/task/BasicExecutionContext.java
 ---
    @@ -242,16 +244,40 @@ public synchronized T get(long timeout, TimeUnit 
unit) throws InterruptedExcepti
             }
         }
         
    +    @Override
    +    public <T> Maybe<T> getImmediately(TaskFactory<Task<T>> 
callableOrSupplier) {
    +        return getImmediatelyInternal(callableOrSupplier);
    +    }
    +    
    +    @Override
    +    public <T> Maybe<T> getImmediately(TaskAdaptable<T> 
callableOrSupplier) {
    +        if (!(callableOrSupplier instanceof TaskFactory)) {
    +            Task<T> t = callableOrSupplier.asTask();
    +            if (!t.isSubmitted()) {
    --- End diff --
    
    I'd like us to go further and say that all calls that pass in a task are 
deprecated. But this is a good first step.
    
    I'd also want us to warn about deprecated usage if someone called 
`getImmediately((Object)task)`


---

Reply via email to