You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 19, 2023. It is now read-only.
The following simple echo stream code does not work:
importallfrom'it-all'conststream=awaitconnection.newStream(echo)constinput=newArray(5).fill(0).map(()=>newUint8Array(10))constoutput=awaitpipe(input,stream,all)console.info('all done')// <- never reached
The reason is the internal _sink method merges the source stream with a "close write iterable" that waits for the closeWritePromise deferred promise to resolve. This is done in the finally block of the sink method.
This block is never reached because the this._sink call doesn't return - it's waiting for the closeWritePromise deferred promise to resolve which creates a deadlock.
The text was updated successfully, but these errors were encountered:
Refactors the stream class in this module to use the abstract superclass from `@libp2p/interface-stream-muxer` as it handles all the various scenarios for closing streams which this module does not.
Fixes#164
The following simple echo stream code does not work:
The reason is the internal
_sink
method merges the source stream with a "close write iterable" that waits for thecloseWritePromise
deferred promise to resolve. This is done in thefinally
block of thesink
method.This block is never reached because the
this._sink
call doesn't return - it's waiting for thecloseWritePromise
deferred promise to resolve which creates a deadlock.The text was updated successfully, but these errors were encountered: