- public $3 handleClose() {
- return new $3();
- }
-
- public class $3 {
-
- public FcpReplySequence with(Consumer<Throwable> consumer) {
- closeHandlers.add(consumer);
- return FcpReplySequence.this;
- }
-
- }
-
- public void waitFor(Supplier<Boolean> endPredicate) {
- this.endPredicate = endPredicate;
- }
-
- public Future<?> send(FcpMessage fcpMessage) throws IOException {
- fcpConnection.addFcpListener(this);
- fcpConnection.sendMessage(fcpMessage);
- return executorService.submit(() -> {
- synchronized (endPredicate) {
- while (!endPredicate.get()) {
- endPredicate.wait();
- }
- }
- return null;
- });