code: public CompletableFuture<Void> close() {
      threadContext.close();
      if (closeOnStop) {
        threadContextFactory.close();
      }
      return CompletableFuture.completedFuture(null);
    }
docs: Closes the primary-backup client.
  
  @return future to be completed once the client is closed