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
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -36,17 +36,17 @@ services can be used to efficiently transmit a continuous flow of BlockItem mess
36
36
37
37
**Producer StreamObserver** - The Producer StreamObserver is a custom implementation of the [gRPC StreamObserver
38
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
+
the Producer StreamObserver at runtime when the producer sends a new BlockItem to the `publishBlockStream` gRPC service.
40
40
41
41
**Consumer StreamObserver** - The Consumer StreamObserver is a custom implementation of the [gRPC StreamObserver
42
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
43
+
the Consumer StreamObserver at runtime when the downstream consumer of the `subscribeBlockStream` gRPC service sends HTTP/2
44
44
responses to sent BlockItems.
45
45
46
-
**subscribe** - Consumers calling the `StreamSource` gRPC service must be affiliated or subscribed with a producer to
46
+
**subscribe** - Consumers calling the `subscribeBlockStream` gRPC service must be affiliated or subscribed with a producer to
47
47
receive a live stream of BlockItems from the `hedera-block-node`.
48
48
49
-
**unsubscribe** - Consumers terminating their connection with the `StreamSource` gRPC service must be unaffiliated or
49
+
**unsubscribe** - Consumers terminating their connection with the `subscribeBlockStream` gRPC service must be unaffiliated or
50
50
unsubscribed from a producer so that internal objects can be cleaned up and resources released.
51
51
52
52
---
@@ -68,12 +68,12 @@ streaming API methods defined above. The following objects are used in all appro
68
68
the Helidon routing mechanism to the gRPC streaming methods called by producers and consumers.
69
69
70
70
`ProducerBlockItemObserver` is a custom implementation of the Helidon gRPC `StreamObserver` interface.
71
-
`BlockItemStreamService` instantiates a new `ProducerBlockItemObserver` instance when the `StreamSink` gRPC method is
71
+
`BlockItemStreamService` instantiates a new `ProducerBlockItemObserver` instance when the `publishBlockStream` gRPC method is
72
72
called by a producer. Thereafter, Helidon invokes `ProducerBlockItemObserver` methods to receive the latest BlockItem
73
73
from the producer and return BlockItemResponses via a bidirectional stream.
74
74
75
75
`ConsumerBlockItemObserver` is also a custom implementation of the Helidon gRPC `StreamObserver` interface.
76
-
`BlockItemStreamService` instantiates a new `ConsumerBlockItemObserver` instance when the `StreamSource` gRPC method
76
+
`BlockItemStreamService` instantiates a new `ConsumerBlockItemObserver` instance when the `subscribeBlockStream` gRPC method
77
77
is called by each consumer. The `ConsumerBlockItemObserver` wraps an instance of `StreamObserver` provided by Helidon
78
78
when the connection is established. The `ConsumerBlockItemObserver` uses the `StreamObserver` to send the latest
79
79
BlockItem to the downstream consumer. Helidon invokes `ConsumerBlockItemObserver` methods to deliver BlockItemResponses
@@ -178,15 +178,15 @@ streams. Please see the following Entities section and Diagrams for a visual rep
178
178
179
179
At boot time, the `BlockItemStreamService` will initialize the `StreamMediator` with the LMAX Disruptor RingBuffer.
180
180
181
-
When a producer calls the `StreamSink` gRPC method, the `BlockItemStreamService` will create a new
181
+
When a producer calls the `publishBlockStream` gRPC method, the `BlockItemStreamService` will create a new
182
182
`ProducerBlockItemObserver` instance for Helidon to invoke during the lifecycle of the bidirectional connection to the
183
183
upstream producer. The `ProducerBlockItemObserver` is constructed with a reference to the `StreamMediator` and to
184
184
the `ResponseStreamObserver` managed by Helidon for transmitting BlockItemResponses to the producer.
185
185
See the Producer Registration Flow diagram for more details.
186
186
187
187
### Consumer Registration Flow
188
188
189
-
When a consumer calls the `StreamSource` gRPC method, the `BlockItemStreamService` will create a new
189
+
When a consumer calls the `subscribeBlockStream` gRPC method, the `BlockItemStreamService` will create a new
190
190
`ConsumerBlockItemObserver` instance for Helidon to invoke during the lifecycle of the bidirectional connection to the
191
191
downstream consumer. The `ConsumerBlockItemObserver` is constructed with a reference to the `StreamMediator` and to
192
192
the `ResponseStreamObserver` managed by Helidon for transmitting BlockItemResponses to the downstream consumer. The
0 commit comments