-
Notifications
You must be signed in to change notification settings - Fork 491
examples: Add gRPC streaming example #339
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured this example is ok to merge, given that we've closed out Read/Write in core. I've got some suggestions for the README but it's not a blocker
This example builds a plugin & client which can stream larger amount of data | ||
between them while staying below reasonable message size limits of the gRPC | ||
protocol. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example builds a plugin & client which can stream larger amount of data | |
between them while staying below reasonable message size limits of the gRPC | |
protocol. | |
This example builds a plugin & client which can stream a large amount of data | |
between them while staying below reasonable message size limits of the gRPC | |
protocol. | |
>Note: [hashicorp/go-plugin sets an upper limit on message size](https://github.com/hashicorp/go-plugin/blob/d0d30899ca2d91b0869cb73db95afca180e769cf/grpc_client.go#L39-L41). At time of writing, that value is `math.MaxInt32` bytes, or approximately 2GB. | |
|
||
## To execute | ||
|
||
Build the plugin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build the plugin | |
Navigate into this example directory | |
\``` | |
cd examples/streaming | |
\``` | |
Next, build the streamer plugin: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how the ``` will behave if the suggestion is accepted. I think the slash will be present in the eventual markdown.
go build -o ./plugin/streamer ./plugin | ||
``` | ||
|
||
launch client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
launch client | |
Finally launch the client: |
|
||
## To re-generate protobuf definitions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## To re-generate protobuf definitions | |
The client will first write data to the steamer plugin, and then the client will read that | |
data back from the plugin. The plugin writes the data it receives in a file called `myfile`, | |
due to the argument passed to the client above. | |
## To re-generate protobuf definitions |
Ah of course we need review from the codeowner |
Closes #158