hashgraph / hedera-block-node

New Block Node services
Apache License 2.0
1 stars 0 forks source link

Refactor Live Stream Mediator to decouple producer from consumer #29

Open mattp-swirldslabs opened 2 weeks ago

mattp-swirldslabs commented 2 weeks ago

With this PR, the live stream of items are broadcast from the producer to all consumers via mediator that all consumers subscribe to. There are concerns that this solution will not scale well with a larger number of consumers. This strategy is also at odds with the framework hooks Helidon provides. The mediator must take greater efforts to make it work.

Given these drawbacks, we should refactor the application to use an intermediate data structure to store the inbound items from the producer. Consumers will then receive BlockItems from the intermediate data structure and pass them back to their downstream consumer.