I think it will be much clearer (and easier to maintain in future) if you call 
lm.readLedgerMetadata at the end of the sequence (after adding the promise to 
outstanding list).

```
GenericCallbackFuture<LedgerMetadata> readPromise = ...;
CompletableFuture<LedgerMetadata> writePromise = readPromise.thenCompose(...);
// register a completion callback when updating ledger metadata completes
writePromise.whenComplete(...);
// add outstanding write to outstanding list
outstanding.add(writePromise);
// trigger the read
lm.readLedgerMetadata(ledgerId, readPromise);
```

[ Full content available at: https://github.com/apache/bookkeeper/pull/1587 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to