@ThreadSafe
public interface ControlClientPool
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.
Modifier and Type | Interface and Description |
---|---|
static interface |
ControlClientPool.Sink
A sink for
InstructionRequestHandlers keyed by worker id. |
static interface |
ControlClientPool.Source
A source of
InstructionRequestHandlers . |
Modifier and Type | Method and Description |
---|---|
ControlClientPool.Sink |
getSink()
Sink for control clients.
|
ControlClientPool.Source |
getSource()
Source of control clients.
|
ControlClientPool.Sink getSink()
ControlClientPool.Source getSource()