Comments (11)
@ejona86 @louiscryan I'm looking at the right place add this...
I suppose I can just add a request(numMessages)
method to Call.Listener
and then have Call.sendPayload
throw if no message has been requested. Thoughts?
from grpc-java.
That requires StreamObserver
to buffer, unless we expose flow control to the applications. Would it be better to be advisory and code is allowed to ignore it if it doesn't care about flow control? Or does this encourage us to adopt full reactive-streams for StreamObserver and require applications to abide by flow control?
from grpc-java.
I was thinking that the stub layer would block until notified since we don't expose flow control at the stub layer. Is that not the behavior we had discussed in the past?
from grpc-java.
I still feel like we can't block when the application calls StreamObserver.onValue. If it can block, then what is the point of going through the agony of using an async interface? If it can block, I suggest we just trash it altogether and tell people to use the blocking interface.
from grpc-java.
Ah right, good point. So I guess we should expose outbound flow control for async clients?
from grpc-java.
@louiscryan What are your ideas for outbound flow control?
from grpc-java.
Discussed offline. Here's the idea...
Basically we just extend Call.Listener
to have the reactivestreams-style request
method.
interface Call.Listener {
void onHeaders(...);
void onPayload(...);
void onClose(...);
void onReady(int numMessages);
}
For now I think the method should be called onReady
rather than request
. First, request
is more of a command which seems out of place in a listener interface. Second, I don't think we'll want to initially be as rigid as the reactivestreams API and fail if the user tries to send more data than has been request. Instead we'll let the user opt-in to outbound flow control, similar to stubby. This will allow the async stub to simply send data immediately without requiring any additional buffering.
I originally considered that onReady
would have no arguments, however if we tell the listener the number of messages that it may send, this gives us some flexibility if we find that requesting one message at a time causes performance hiccups.
WDYT?
from grpc-java.
@louiscryan @ejona86 any thoughts before I start hacking? :)
from grpc-java.
@nmittler, SGTM.
from grpc-java.
Request is a command in reactive streams hence its lack of "on". It's the
onStart or onNext callbacks issuing a command for data back upwards to the
source.
On Feb 12, 2015 10:36 AM, "Nathan Mittler" [email protected] wrote:
Discussed offline. Here's the idea...
Basically we just extend Call.Listener to have the reactivestreams-style
request method.interface Call.Listener {
void onHeaders(...);
void onPayload(...);
void onClose(...);
void onReady(int numMessages);
}For now I think the method should be called onReady rather than request.
First, request is more of a command which seems out of place in a
listener interface. Second, I don't think we'll want to initially be as
rigid as the reactivestreams API and fail if the user tries to send more
data than has been request. Instead we'll let the user opt-in to outbound
flow control, similar to stubby. This will allow the async stub to simply
send data immediately without requiring any additional buffering.I originally considered that onReady would have no arguments, however if
we tell the listener the number of messages that it may send, this gives us
some flexibility if we find that requesting one message at a time causes
performance hiccups.WDYT?
—
Reply to this email directly or view it on GitHub
#6 (comment).
from grpc-java.
Fixed by #348
from grpc-java.
Related Issues (20)
- What does "length" means in i.g.n.NettyClientHandler INBOUND DATA HOT 2
- GRPC Java MAX_CONCURRENT_STREAMS vs maxConcurrentCallsPerConnection HOT 1
- BinderChannel: allow kotlinx.serialization as protobuf alternative HOT 2
- Found one potential memory leak logic
- Examples fail to build on JDK 22 HOT 2
- Track OpenTelemetry Tracing being experimental
- connection reset using firebase firestore using Php and Html HOT 1
- Add a global TypeRegistry, similar to the Go implementation HOT 1
- MultiChildLb unconditionally calls requestConnection() HOT 4
- IS_PETIOLE_POLICY is not used by PickFirstLeafLoadBalancer
- Pumping to version 1.65.2 from version 1.62.2 gave the following error 'failed with code: BACKEND_FAILURE_URL_UNREACHABLE' HOT 1
- I can't run the android client example. HOT 2
- Unexpected INTERNAL error io.grpc.StatusRuntimeException: INTERNAL: http2 exception HOT 2
- Header size exceeded max allowed size (10240) HOT 6
- xds: Incorrect load reporting when using pick first as locality-routing policy
- Got ClassNotFoundException while building native image with grpc-netty-shaded HOT 1
- Android grpc with UDS is slow to connect sometimes HOT 6
- Add CI build with netty 4.2.0.Alpha snapshots / releases HOT 10
- monitoring component for related performance indicators (such as rt qps error rate, etc.) HOT 1
- Release notes for 1.66.0
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-java.