Comments (2)
It's deliberate. There's no need for an extra argument. A context is request-scoped, but so is the generated stream type. It doesn't make sense to talk about modifying the context for returning stream responses. gRPC isn't a general purpose proto/http2 interface, it's for RPCs specifically. There's a metadata package that is for attaching extra information.
from grpc-go.
I understand there's no need for it, but from a usability perspective, this was frustrating for me. It's inconsistent with the handler APIs generated for unary RPCs which is disorienting, but it's also inconsistent with the client API for streaming RPCs which take a context as their first parameter just like unary calls.
My initial thought was "do streaming RPC's not support a context? And then I had to chase down documentation the definition of the generated Stream type and then it's embedded interfaces grpc.ServerStream
and grpc.Stream
before I found it.
from grpc-go.
Related Issues (20)
- Is it possible to split service implementaion? HOT 3
- Deprecation of `DialContext` and `Dial` is not mentioned in 1.63.0 release notes HOT 3
- bufnet not supported by NewClient() ? HOT 5
- Please release upgrade /cmd/protoc-gen-go-grpc /go.mod to security fixed protobuf v1.33.0 HOT 2
- Confusing for NewClient in 1.63 HOT 4
- Deprecate WithBlock and WithReturnConnectionError HOT 3
- gRPC casing looks really ugly [Serious] HOT 2
- resolver.Address's BalancerAttributes update will not reflect in Balancer HOT 3
- How to modify the returned metadata HOT 3
- In picker logic(picker_wrapper.go), clearly understand the real reason for failures after a context.Error(timeout) HOT 2
- rpc error: code = Internal desc = header key "myheader" contains value with non-printable ASCII characters HOT 1
- Move pick_first to separate package
- run staticcheck for all modules
- header key "XXX" contains value with non-printable ASCII characters HOT 1
- Service reflection can not handle directory paths with imported proto files HOT 1
- Delete grpclog's Debugf function HOT 3
- feature: `protoc-gen-go-grpc` to create test client / `bufconn` constructors HOT 2
- Flaky test: TestClientSendsAGoAway HOT 8
- Catching grpc connection configuration errors at startup HOT 2
- CloseSend immediately after Send
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grpc-go.