New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve examples. #182
Improve examples. #182
Conversation
Hmm, I added some error propagation for the in parallel steps, but I'm not happy with it, since it defers errors until the end. |
Are errors likely to occur per stream, or are they all fatal to the transport? |
Ended up reporting per stream, since the iteration on |
For those interested, I wrote a quick polyfill (demo) to verify this for await (const stream of transport.incomingUnidirectionalStreams) {
await stream.readable.pipeThrough(new TextDecoderStream("utf-8")).pipeTo(new WritableConsole());
} I dunno if it's production ready or anything, but it appears to work right in Canary. |
For those curious, the reason for not reading in parallel here is to avoid interleaving the text output, since it's going to a combined log. Now that I think about it, that might be good to show in the text decoder example. |
break; | ||
} | ||
} | ||
} catch (e) { | ||
addToEventLog('Error while sending data: ' + e, 'error'); | ||
addToEventLog(`Error while sending data: ${e}`, 'error'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't use <![CDATA[
blocks so that this quoting is not necessary?
Preview | Diff