@Override
  protected void initChannel(final C ch) throws Exception {
    ch.eventLoop()
        .schedule(
            () -> {
              if (!condition.get()) {
                callback.invoke();
                ch.close();
              }
            },
            timeoutInSeconds,
            TimeUnit.SECONDS);
  }
This handler will close the associated connection if the given condition is not met within the
timeout window.
ethereum/p2p/src/main/java/org/hyperledger/besu/ethereum/p2p/rlpx/connections/netty/TimeoutHandler.java