git ssb

2+

Dominic / pull-stream



Commit ba7f368b81bcbddeae02d80184c379d5c849a24b

document order that callbacks must be called during an abort

Dominic Tarr committed on 4/24/2016, 8:22:13 AM
Parent: a4e2fe6fffcdd836e472a276536499fee878188e

Files changed

spec.mdchanged
spec.mdView
@@ -25,8 +25,10 @@
2525 Sometimes it's the sink that errors, and if it can't read anymore then we _must_ abort the source. (example, source is a file stream from local fs, and sink is a http upload. prehaps the network drops or remote server crashes, in this case we should abort the source, so that it's resources can be released.)
2626
2727 To abort the sink, call read with a truthy first argument. You may abort a source _before_ it has returned from a regular read. (if you wait for the previous read to complete, it's possible you'd get a deadlock, if you a reading a stream that takes a long time, example, `tail -f` is reading a file, but nothing has appended to that file yet).
2828
29+When a stream is aborted during a read, the callback provided to the read function *must* be called first, with an error, and then the abort callback.
30+
2931 ## Sink Streams
3032
3133 A Sink Stream (aka writable stream) is a function that a Source Stream is passed to. The Sink Stream calls the `read` function of the Source Stream, abiding by the rules about when it may not call.
3234

Built with git-ssb-web