Skip to content

Commit 3228b8b

Browse files
fix: changed StreamSink and StreamSource to hedera-protobufs rpc definitions
Signed-off-by: Matt Peterson <[email protected]>
1 parent 540a78d commit 3228b8b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

server/docs/design/bidi-producer-consumers-streaming.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ services can be used to efficiently transmit a continuous flow of BlockItem mess
3636

3737
**Producer StreamObserver** - The Producer StreamObserver is a custom implementation of the [gRPC StreamObserver
3838
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.
4040

4141
**Consumer StreamObserver** - The Consumer StreamObserver is a custom implementation of the [gRPC StreamObserver
4242
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
4444
responses to sent BlockItems.
4545

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
4747
receive a live stream of BlockItems from the `hedera-block-node`.
4848

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
5050
unsubscribed from a producer so that internal objects can be cleaned up and resources released.
5151

5252
---
@@ -68,12 +68,12 @@ streaming API methods defined above. The following objects are used in all appro
6868
the Helidon routing mechanism to the gRPC streaming methods called by producers and consumers.
6969

7070
`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
7272
called by a producer. Thereafter, Helidon invokes `ProducerBlockItemObserver` methods to receive the latest BlockItem
7373
from the producer and return BlockItemResponses via a bidirectional stream.
7474

7575
`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
7777
is called by each consumer. The `ConsumerBlockItemObserver` wraps an instance of `StreamObserver` provided by Helidon
7878
when the connection is established. The `ConsumerBlockItemObserver` uses the `StreamObserver` to send the latest
7979
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
178178

179179
At boot time, the `BlockItemStreamService` will initialize the `StreamMediator` with the LMAX Disruptor RingBuffer.
180180

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
182182
`ProducerBlockItemObserver` instance for Helidon to invoke during the lifecycle of the bidirectional connection to the
183183
upstream producer. The `ProducerBlockItemObserver` is constructed with a reference to the `StreamMediator` and to
184184
the `ResponseStreamObserver` managed by Helidon for transmitting BlockItemResponses to the producer.
185185
See the Producer Registration Flow diagram for more details.
186186

187187
### Consumer Registration Flow
188188

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
190190
`ConsumerBlockItemObserver` instance for Helidon to invoke during the lifecycle of the bidirectional connection to the
191191
downstream consumer. The `ConsumerBlockItemObserver` is constructed with a reference to the `StreamMediator` and to
192192
the `ResponseStreamObserver` managed by Helidon for transmitting BlockItemResponses to the downstream consumer. The

0 commit comments

Comments
 (0)