Skip to content

Commit

Permalink
Allow either typed or untyped coroutine state
Browse files Browse the repository at this point in the history
  • Loading branch information
chriso committed Jun 11, 2024
1 parent fb5b1bf commit 8669b0b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions dispatch/sdk/v1/poll.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check failure on line 16 in dispatch/sdk/v1/poll.proto

View workflow job for this annotation

GitHub Actions / breaking

Field "1" with name "coroutine_state" on message "Poll" changed cardinality from "optional with implicit presence" to "optional with explicit presence".

Check failure on line 16 in dispatch/sdk/v1/poll.proto

View workflow job for this annotation

GitHub Actions / breaking

Field "1" with name "coroutine_state" on message "Poll" moved from outside to inside a oneof.
google.protobuf.Any typed_coroutine_state = 6;
}

// Calls to make asynchronously.
repeated Call calls = 2;
Expand Down Expand Up @@ -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;

Check failure on line 55 in dispatch/sdk/v1/poll.proto

View workflow job for this annotation

GitHub Actions / breaking

Field "1" with name "coroutine_state" on message "PollResult" changed cardinality from "optional with implicit presence" to "optional with explicit presence".

Check failure on line 55 in dispatch/sdk/v1/poll.proto

View workflow job for this annotation

GitHub Actions / breaking

Field "1" with name "coroutine_state" on message "PollResult" moved from outside to inside a oneof.
google.protobuf.Any typed_coroutine_state = 4;
}

// The list of results from calls that were made by the coroutine and
// completed during the poll.
Expand All @@ -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;
}

0 comments on commit 8669b0b

Please sign in to comment.