From 8669b0b48270240e8acfca0ae927aef685791a23 Mon Sep 17 00:00:00 2001 From: Chris O'Hara Date: Wed, 12 Jun 2024 09:10:09 +1000 Subject: [PATCH] Allow either typed or untyped coroutine state --- dispatch/sdk/v1/poll.proto | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dispatch/sdk/v1/poll.proto b/dispatch/sdk/v1/poll.proto index 0a48a2d..f29e8a6 100644 --- a/dispatch/sdk/v1/poll.proto +++ b/dispatch/sdk/v1/poll.proto @@ -12,7 +12,10 @@ import "google/protobuf/duration.proto"; message Poll { // Snapshot of the coroutine state that will be used in the next run to // resume the function. - bytes coroutine_state = 1 [deprecated = true]; + oneof state { + bytes coroutine_state = 1; + google.protobuf.Any typed_coroutine_state = 6; + } // Calls to make asynchronously. repeated Call calls = 2; @@ -42,14 +45,16 @@ message Poll { ]; // State of the function. The same state is sent back on the PollResult. - google.protobuf.Any state = 6; } // PollResult is the response to a Poll directive. message PollResult { // The coroutine state that was recorded by the coroutine when it was last // paused. - bytes coroutine_state = 1 [deprecated = true]; + oneof state { + bytes coroutine_state = 1; + google.protobuf.Any typed_coroutine_state = 4; + } // The list of results from calls that were made by the coroutine and // completed during the poll. @@ -59,7 +64,4 @@ message PollResult { // that none of the calls were dispatched, and must be resubmitted // after the error cause has been resolved. Error error = 3; - - // State of the function when polling. - google.protobuf.Any state = 4; }