|
6 | 6 | -- | Open process streams with |
7 | 7 | -- | [__Node.Process__](https://pursuit.purescript.org/packages/purescript-node-process/docs/Node.Process). |
8 | 8 | -- | |
| 9 | +-- | Read and write strings with the __toString__ and __fromString__ functions in |
| 10 | +-- | [__Node.Buffer__](https://pursuit.purescript.org/packages/purescript-node-buffer/docs/Node.Buffer#t:MutableBuffer). |
| 11 | +-- | |
9 | 12 | -- | All I/O errors will be thrown through the `Aff` `MonadError` class |
10 | 13 | -- | instance. |
11 | 14 | -- | |
|
21 | 24 | -- | [`readable.read([size])`](https://nodejs.org/docs/latest/api/stream.html#readablereadsize) |
22 | 25 | -- | function and are subject to the caveats of that function. |
23 | 26 | -- | |
24 | | --- | #### Results |
| 27 | +-- | #### Result Buffers |
25 | 28 | -- | |
26 | 29 | -- | The result of a reading function may be chunked into more than one `Buffer`. |
27 | 30 | -- | The `fst` element of the result `Tuple` is an `Array Buffer` of what |
|
42 | 45 | -- | <- liftEffect $ Array.foldM (\a b -> (a+_) <$> size b) 0 inputs |
43 | 46 | -- | ``` |
44 | 47 | -- | |
| 48 | +-- | #### Result `readagain` flag |
| 49 | +-- | |
45 | 50 | -- | The `snd` element of the result `Tuple` is a `Boolean` flag which |
46 | 51 | -- | is `true` if the stream has not reached End-Of-File (and also if the stream |
47 | | --- | has not errored or been destroyed.) If the flag is `false` then |
| 52 | +-- | has not errored or been destroyed), so we know we can read again. |
| 53 | +-- | If the flag is `false` then |
48 | 54 | -- | no more bytes will ever be produced by the stream. |
49 | 55 | -- | |
| 56 | +-- | Reading from an ended, closed, errored, or destroyed stream |
| 57 | +-- | will complete immediately with `Tuple [] false`. |
| 58 | +-- | |
50 | 59 | -- | #### Canceller argument |
51 | 60 | -- | |
52 | 61 | -- | The reading functions suffixed with underscore take a canceller argument. |
|
0 commit comments