-
public final class APIGatewayServiceGrpcKt.APIGatewayServiceCoroutineStub extends AbstractCoroutineStub<APIGatewayServiceGrpcKt.APIGatewayServiceCoroutineStub>
A stub for issuing RPCs to a(n) gateway.v1.APIGatewayService service as suspending coroutines.
-
-
Constructor Summary
Constructors Constructor Description APIGatewayServiceGrpcKt.APIGatewayServiceCoroutineStub(Channel channel, CallOptions callOptions)APIGatewayServiceGrpcKt.APIGatewayServiceCoroutineStub(Channel channel)
-
Method Summary
Modifier and Type Method Description final PromptResponserequestPrompt(PromptRequest request, Metadata headers)Executes this RPC and returns the response message, suspending until the RPC completes with Status.OK.final Flow<StreamingPromptResponse>requestStreamingPrompt(PromptRequest request, Metadata headers)Returns a Flow that, when collected, executes this RPC and emits responses from the server as they arrive. -
Methods inherited from class io.grpc.kotlin.AbstractCoroutineStub
getCallOptions, getChannel, withCallCredentials, withChannel, withCompression, withDeadline, withDeadlineAfter, withExecutor, withInterceptors, withMaxInboundMessageSize, withMaxOutboundMessageSize, withOption, withWaitForReady -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
requestPrompt
final PromptResponse requestPrompt(PromptRequest request, Metadata headers)
Executes this RPC and returns the response message, suspending until the RPC completes with
Status.OK. If the RPC completes with another status, a corresponding StatusException is thrown. If this coroutine is cancelled, the RPC is also cancelled with the corresponding exception as a cause.- Parameters:
request- The request message to send to the server.headers- Metadata to attach to the request.
-
requestStreamingPrompt
final Flow<StreamingPromptResponse> requestStreamingPrompt(PromptRequest request, Metadata headers)
Returns a Flow that, when collected, executes this RPC and emits responses from the server as they arrive. That flow finishes normally if the server closes its response with
Status.OK, and fails by throwing a StatusException otherwise. If collecting the flow downstream fails exceptionally (including via cancellation), the RPC is cancelled with that exception as a cause.- Parameters:
request- The request message to send to the server.headers- Metadata to attach to the request.
-
-
-
-