Skip to content

Commit

Permalink
Implement streaming response for
Browse files Browse the repository at this point in the history
TriggerUserPipeline RPC

Modify the TriggerUserPipeline RPC method to return a stream of
TriggerUserPipelineResponse messages instead of a single response.
Update the URL to include the :stream suffix, indicating the streaming
behavior of the endpoint.
The streaming response allows clients to receive pipeline results
incrementally as they become available, reducing latency and improving
real-time inference capabilities.
  • Loading branch information
tillknuesting committed Apr 30, 2024
1 parent 56888e6 commit 8e19452
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions vdp/pipeline/v1beta/pipeline_public_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -180,20 +180,21 @@ service PipelinePublicService {
option (google.api.method_signature) = "name,inputs";
}

// Trigger a pipeline owned by a user
//
// Triggers the execution of a pipeline and streams the results back to the user.
// This method is intended for real-time inference when low latency is of concern.
//
// The pipeline is identified by its resource name, formed by the parent user
// and ID of the pipeline.
//
// The response is returned as a stream of data, allowing the client to receive
// the results incrementally as they become available.
//
// For more information, see [Trigger
// Pipeline](TODO: Add link).
rpc TriggerUserPipeline(TriggerUserPipelineRequest) returns (TriggerUserPipelineResponse) {

// Trigger a pipeline owned by a user
//
// Triggers the execution of a pipeline and streams the results back to the user.
// This method is intended for real-time inference when low latency is of concern.
//
// The pipeline is identified by its resource name, formed by the parent user
// and ID of the pipeline.
//
// The response is returned as a stream of data, allowing the client to receive
// the results incrementally as they become available.
//
// For more information, see [Run
// Pipeline](https://www.instill.tech/docs/vdp/run).
rpc TriggerUserPipelineStream(TriggerUserPipelineRequest) returns (stream TriggerUserPipelineResponse) {

Check failure on line 197 in vdp/pipeline/v1beta/pipeline_public_service.proto

View workflow job for this annotation

GitHub Actions / buf-check

"vdp.pipeline.v1beta.TriggerUserPipelineRequest" is used as the request or response type for multiple RPCs.

Check failure on line 197 in vdp/pipeline/v1beta/pipeline_public_service.proto

View workflow job for this annotation

GitHub Actions / buf-check

"vdp.pipeline.v1beta.TriggerUserPipelineResponse" is used as the request or response type for multiple RPCs.

Check failure on line 197 in vdp/pipeline/v1beta/pipeline_public_service.proto

View workflow job for this annotation

GitHub Actions / buf-check

RPC request type "TriggerUserPipelineRequest" should be named "TriggerUserPipelineStreamRequest" or "PipelinePublicServiceTriggerUserPipelineStreamRequest".

Check failure on line 197 in vdp/pipeline/v1beta/pipeline_public_service.proto

View workflow job for this annotation

GitHub Actions / buf-check

RPC response type "TriggerUserPipelineResponse" should be named "TriggerUserPipelineStreamResponse" or "PipelinePublicServiceTriggerUserPipelineStreamResponse".
option (google.api.http) = {
post: "/v1beta/{name=users/*/pipelines/*}/trigger:stream"
body: "*"
Expand Down

0 comments on commit 8e19452

Please sign in to comment.