Skip to content

feat: use SSE for issuance#224

Open
TomasArrachea wants to merge 2 commits intotomasarrachea-retrieve-issuancefrom
tomasarrachea-sse-on-issuance
Open

feat: use SSE for issuance#224
TomasArrachea wants to merge 2 commits intotomasarrachea-retrieve-issuancefrom
tomasarrachea-sse-on-issuance

Conversation

@TomasArrachea
Copy link
Collaborator

@TomasArrachea TomasArrachea commented Feb 11, 2026

closes #97.

This PR removes the metadata polling made by the frontend and replaces it with a new issuance SSE endpoint. This endpoint sends an event each time the issuance gets updated, that is triggered after each mint.

@TomasArrachea TomasArrachea force-pushed the tomasarrachea-sse-on-issuance branch from 66c0009 to defc5d5 Compare February 11, 2026 19:54
@TomasArrachea TomasArrachea force-pushed the tomasarrachea-sse-on-issuance branch from defc5d5 to 6962802 Compare February 11, 2026 20:01
@TomasArrachea TomasArrachea force-pushed the tomasarrachea-retrieve-issuance branch from 9f31dd4 to efd23da Compare February 11, 2026 20:19
@TomasArrachea TomasArrachea marked this pull request as ready for review February 11, 2026 21:44
Comment on lines +22 to +23
let stream = WatchStream::new(server.issuance_receiver)
.map(|value| Ok(Event::default().event("issuance").data(value.base_units().to_string())));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit unfamiliar with this, not really sure how this is being updated. Also, this is sent to the clients at every update, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, after each minting the faucet updates the issuance value and clients get sent an update event though this stream.

Before, clients had to poll the metadata endpoint instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants