You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: server/docs/design/bidi-producer-consumers-streaming.md
+10-9
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,8 @@ point for custom logic is an implementation of `GrpcService`.
17
17
## Goals
18
18
19
19
1) Consumers must be able to dynamically subscribe and unsubscribe from the live stream of BlockItems emitted by the
20
-
producer.
20
+
producer. When a consumer subscribes to the stream, they will begin receiving BlockItems at the start of the next Block.
21
+
BlockItems transiting before the next Block will be discarded and not sent to the downstream consumer.
21
22
2) Correct, in-order streaming delivery of BlockItems from a producer to all registered consumers.
22
23
3) Minimize latency between the producer and consumers.
23
24
4) Minimize CPU resources consumed by the producer and consumers.
@@ -29,18 +30,18 @@ point for custom logic is an implementation of `GrpcService`.
29
30
**BlockItem** - The BlockItem is the primary data structure passed between the producer, the `hedera-block-node`
30
31
and consumers. A defined sequence of BlockItems represent a Block when stored on the `hedera-block-node`.
31
32
32
-
**Bidirectional Streaming** - Bidirectional streaming is an [HTTP/2 feature](https://datatracker.ietf.org/doc/html/rfc9113#name-streams-and-multiplexing)allowing both a client and a server to emit
33
-
a continuous stream of frames without waiting for responses. In this way, gRPC services can be used to efficiently
34
-
transmit a continuous flow of BlockItem messages while the HTTP/2 connection is open.
33
+
**Bidirectional Streaming** - Bidirectional streaming is an [HTTP/2 feature](https://datatracker.ietf.org/doc/html/rfc9113#name-streams-and-multiplexing)
34
+
allowing both a client and a server emit a continuous stream of frames without waiting for responses. In this way, gRPC
35
+
services can be used to efficiently transmit a continuous flow of BlockItem messages while the HTTP/2 connection is open.
35
36
36
37
**Producer StreamObserver** - The Producer StreamObserver is a custom implementation of the [gRPC StreamObserver
37
-
interface](https://github.com/grpc/grpc-java/blob/0ff3f8e4ac4c265e91b4a0379a32cf25a0a2b2f7/stub/src/main/java/io/grpc/stub/StreamObserver.java#L45) used by Helidon. It is initialized by the BlockItemStreamService (see Entities section). Helidon invokes the Producer
38
-
StreamObserver at runtime when the producer sends a new BlockItem to the `StreamSink` gRPC service.
38
+
interface](https://github.com/grpc/grpc-java/blob/0ff3f8e4ac4c265e91b4a0379a32cf25a0a2b2f7/stub/src/main/java/io/grpc/stub/StreamObserver.java#L45) used by Helidon. It is initialized by the BlockItemStreamService (see Entities section). Helidon invokes
39
+
the Producer StreamObserver at runtime when the producer sends a new BlockItem to the `StreamSink` gRPC service.
39
40
40
41
**Consumer StreamObserver** - The Consumer StreamObserver is a custom implementation of the [gRPC StreamObserver
41
-
interface](https://github.com/grpc/grpc-java/blob/0ff3f8e4ac4c265e91b4a0379a32cf25a0a2b2f7/stub/src/main/java/io/grpc/stub/StreamObserver.java#L45) used by Helidon. It is initialized by the BlockItemStreamService (see Entities section). Helidon invokes the Consumer
42
-
StreamObserver at runtime when the downstream consumer of the `StreamSource` gRPC service sends HTTP/2 responses to
43
-
sent BlockItems.
42
+
interface](https://github.com/grpc/grpc-java/blob/0ff3f8e4ac4c265e91b4a0379a32cf25a0a2b2f7/stub/src/main/java/io/grpc/stub/StreamObserver.java#L45) used by Helidon. It is initialized by the BlockItemStreamService (see Entities section). Helidon invokes
43
+
the Consumer StreamObserver at runtime when the downstream consumer of the `StreamSource` gRPC service sends HTTP/2
44
+
responses to sent BlockItems.
44
45
45
46
**subscribe** - Consumers calling the `StreamSource` gRPC service must be affiliated or subscribed with a producer to
46
47
receive a live stream of BlockItems from the `hedera-block-node`.
0 commit comments