Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Add changeset that describes the new subscriptions API
Browse files Browse the repository at this point in the history
  • Loading branch information
steveluscher committed Oct 15, 2024
1 parent 672ca49 commit c8e6e71
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .changeset/wild-beers-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@solana/rpc-subscriptions': patch
'@solana/rpc-subscriptions-api': patch
'@solana/rpc-subscriptions-channel-websocket': patch
'@solana/rpc-subscriptions-spec': patch
---

We refactored the lower levels of the subscriptions API entirely.

Previously, all layers of the subscriptions implementation, from the `WebSocket` transport to the API that developers use, dealt in `AsyncIterables`. These are notoriously difficult to code in such a way that expresses all of the ways in which a subscription might be cancelled or error out. Very slight omissions of care could open memory leaks that would bring down the simplest of apps. The new subscriptions infra in Release Candidate 2 deals with event-based subscriptions all the way up to the highest level API, at which point the subscription is vended to the application as an `AsyncIterable`.

This has eliminated several classes of memory leak and has made it easier to implement higher-level transports (like the autopinger and the subscription coalescer). Additionally, this update introduces a new channel pool implementation that opens new `WebSocket` connections when existing ones become ‘full.’ Lastly, performance in the new implementation has been improved through a new demultiplexing utility that can separate `message` events into several channels based on arbitrary criteria, meaning you can apply transforms to the message right at the source, and vend subscriptions to downstream consumers that care only about one particular kind of message.

0 comments on commit c8e6e71

Please sign in to comment.