Skip to content

Instantly share code, notes, and snippets.

@engineersamuel
Created June 13, 2024 16:58
Show Gist options
  • Save engineersamuel/14d6ec613ec537c9c0c41f1ab4824544 to your computer and use it in GitHub Desktop.
Save engineersamuel/14d6ec613ec537c9c0c41f1ab4824544 to your computer and use it in GitHub Desktop.
await getBytes(response.body!, getLines(getMessages(id => {
if (id) {
// store the id and send it back on the next retry:
headers[LastEventId] = id;
} else {
// don't send the last-event-id header anymore:
delete headers[LastEventId];
}
}, retry => {
retryInterval = retry;
}, onmessage)));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment