brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] brooklyn-server pull request #853: [WIP] deprecate Task as values in config ...
Date Thu, 05 Oct 2017 13:23:22 GMT
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)`


---

Mime
View raw message