Class IntakeHandoffStreamClient

java.lang.Object
ai.pipeline.connector.intake.service.IntakeHandoffStreamClient

@ApplicationScoped public class IntakeHandoffStreamClient extends Object
intake-service → engine streaming intake-handoff lane. Mirror of the kafka-sidecar's IntakeHandoffStreamClient. Keeps a single bidi stream open to engine for the lifetime of the JVM so per-call buffer allocation pressure cannot trigger INTERNAL: Half-closed without a request on the per-doc handoff path.

Replaces N unary intakeHandoff calls per N docs with one bidi stream for the whole intake. Each intakeHandoff call blocks the calling virtual thread on a per-handoff future until the engine acks.

Failure semantics:

  • STATUS_ACCEPTED — engine admitted; method returns the inner IntakeHandoffResponse.
  • STATUS_RETRYABLE_REJECTED — synthetic StatusRuntimeException with UNAVAILABLE.
  • STATUS_PERMANENT_REJECTED — synthetic StatusRuntimeException with FAILED_PRECONDITION.
  • Stream-level error → all in-flight futures fail; next intakeHandoff(IntakeHandoffRequest) call reopens the stream lazily.
  • Constructor Details

    • IntakeHandoffStreamClient

      public IntakeHandoffStreamClient()
  • Method Details

    • intakeHandoff

      public ai.pipestream.engine.v1.IntakeHandoffResponse intakeHandoff(ai.pipestream.engine.v1.IntakeHandoffRequest request)
      Sends one intake handoff over the lane. Blocks the calling virtual thread on a per-handoff future until the engine acks.
      Parameters:
      request - the engine handoff request
      Returns:
      the engine's per-doc ack on STATUS_ACCEPTED
      Throws:
      io.grpc.StatusRuntimeException - UNAVAILABLE on retryable rejection, FAILED_PRECONDITION on permanent rejection, DEADLINE_EXCEEDED on ack timeout