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 #816: Tasks code improvements - prep for better...
Date Thu, 28 Sep 2017 12:52:22 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/816#discussion_r141596090
  
    --- Diff: core/src/main/java/org/apache/brooklyn/util/core/task/BasicTask.java ---
    @@ -256,6 +246,17 @@ public synchronized void initInternalFuture(ListenableFuture<T>
result) {
             if (submittedByTask==null) return null;
             return submittedByTask.orNull(); 
         }
    +    @Override
    +    public String getSubmittedByTaskId() {
    +        if (submittedByTask==null || submittedByTask.isAbsent()) return null;
    --- End diff --
    
    I'd instead change `setSubmittedByTask(Maybe<Task>)` to `setSubmittedByTask(Maybe<Task>,
String taskId)`, and store the `taskId` as a field. That would feel much simpler, and would
decreasing the coupling between what extra things this code handles (i.e. the `MaybeSupplier`
that implements `Identifiable`) and the code that calls it.


---

Mime
View raw message