Interface ControlClientPool

All Known Implementing Classes:
MapControlClientPool

@ThreadSafe public interface ControlClientPool
A pool of control clients that brokers incoming SDK harness connections (in the form of InstructionRequestHandlers.

Incoming instruction handlers usually come from the control plane gRPC service. Typical use:

   // Within owner of the pool, who may or may not own the control plane server as well
   ControlClientPool pool = ...
   FnApiControlClientPoolService service =
       FnApiControlClientPoolService.offeringClientsToSink(pool.getSink(), headerAccessor)
   // Incoming gRPC control connections will now be added to the client pool.

   // Within code that interacts with the instruction handler. The get call blocks until an
   // incoming client is available:
   ControlClientSource clientSource = ... InstructionRequestHandler
   instructionHandler = clientSource.get("worker-id");
 

All ControlClientPool implementations must be thread-safe.