hyperledger-iroha / iroha

Iroha - A simple, enterprise-grade decentralized ledger
https://wiki.hyperledger.org/display/iroha
Apache License 2.0
443 stars 278 forks source link

Proposal: use Server-Sent Events instead of WebSocket #4910

Open 0x009922 opened 4 months ago

0x009922 commented 4 months ago

WebSocket is overkill for Events and Block Stream APIs - they aren't bidirectional. Server-Sent Events is a simpler and more robust HTTP-native alternative (e.g. used by ChatGPT streaming responses).

Benefits:

Downsides:

DCNick3 commented 4 months ago

Text-only seems like a big showstopper to me. One alternative I can see is to use own own event streaming format, with support for binary events (and probably without event id?).

AFAIU, you still can handle that in the browser environment with fetch API. We'd have to implement the reconnection ourselves though..