HomePhabricator

[chronik-client] Improve websocket failover proxy

Description

[chronik-client] Improve websocket failover proxy

Summary:
The implementation of websocket in failover proxy causes the app to open multiple websocket connections. This is an async operation. There is no guarantee that the index that comes first will be the websocket that opens first. Using for loops with async functions, we need to await to make sure that we know what we are getting. We also need to await this async method. Currently it is called in the constructor where await is not supported. Move this call to initialization.

Fix resolved to resolve typo.

Test Plan: Before this diff, npm test will pass but also hang indefinitely. After this diff, npm test resolves.

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D14766

Details

Provenance
bytesofmanAuthored on Nov 9 2023, 13:46
bytesofmanPushed on Nov 16 2023, 15:19
Reviewer
Restricted Project
Differential Revision
D14766: [chronik-client] Improve websocket failover proxy
Parents
rABC84eb88e72f55: [chronik-client] Remove test dependency on reindexing node
Branches
Unknown
Tags
Unknown