Get or create a Future for a messageHash. If a rejection was queued before the future existed, reject it immediately.
(String messageHash)
| 175 | * If a rejection was queued before the future existed, reject it immediately. |
| 176 | */ |
| 177 | public Future future(String messageHash) { |
| 178 | Future f = futuresMap().computeIfAbsent(messageHash, k -> new Future()); |
| 179 | Object rejection = rejectionsMap().remove(messageHash); |
| 180 | if (rejection != null) { |
| 181 | f.reject(rejection); |
| 182 | } |
| 183 | return f; |
| 184 | } |
| 185 | |
| 186 | public Future reusableFuture(String messageHash) { |
| 187 | return this.future(messageHash); |