Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid opaque byte fields/containers #35

Merged
merged 8 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion buf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ deps:
- buf.build/bufbuild/protovalidate
breaking:
use:
- FILE
- WIRE_JSON
except:
- FIELD_SAME_ONEOF
lint:
use:
- DEFAULT
10 changes: 10 additions & 0 deletions dispatch/sdk/python/v1/pickled.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
syntax = "proto3";

package dispatch.sdk.python.v1;

// Pickled is a wrapper for a value that was serialized with
// the Python pickle package.
message Pickled {
// Pickled representation of a value.
bytes pickled_value = 1;
}
11 changes: 9 additions & 2 deletions dispatch/sdk/v1/poll.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@ package dispatch.sdk.v1;
import "buf/validate/validate.proto";
import "dispatch/sdk/v1/call.proto";
import "dispatch/sdk/v1/error.proto";
import "google/protobuf/any.proto";
import "google/protobuf/duration.proto";

// Poll is a directive to make asynchronous calls and join on their results.
message Poll {
// Snapshot of the coroutine state that will be used in the next run to
// resume the function.
bytes coroutine_state = 1;
oneof state {
bytes coroutine_state = 1;
google.protobuf.Any typed_coroutine_state = 6;
}

// Calls to make asynchronously.
repeated Call calls = 2;
Expand Down Expand Up @@ -45,7 +49,10 @@ message Poll {
message PollResult {
// The coroutine state that was recorded by the coroutine when it was last
// paused.
bytes coroutine_state = 1;
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.
Expand Down
Loading