#import <GRXBufferedPipe.h>
Class Methods | |
(instancetype) | + pipe |
![]() | |
(instancetype) | + emptyWriter |
(instancetype) | + writerWithContainer: |
(instancetype) | + writerWithEnumerator: |
(instancetype) | + writerWithError: |
(instancetype) | + writerWithValue: |
(instancetype) | + writerWithValueSupplier: |
Additional Inherited Members | |
![]() | |
(void) | - finishWithError: |
(GRXWriter *) | - map: |
(void) | - startWithWriteable: |
![]() | |
(void) | - writesFinishedWithError: |
(void) | - writeValue: |
![]() | |
GRXWriterState | state |
A buffered pipe is a Writer that also acts as a Writeable. Once it is started, whatever values are written into it (via -writeValue:) will be propagated immediately, unless flow control prevents it. If it is throttled and keeps receiving values, as well as if it receives values before being started, it will buffer them and propagate them in order as soon as its state becomes Started. If it receives an end of stream (via -writesFinishedWithError:), it will buffer the EOS after the last buffered value and issue it to the writeable after all buffered values are issued.
Beware that a pipe of this type can't prevent receiving more values when it is paused (for example if used to write data to a congested network connection). Because in such situations the pipe will keep buffering all data written to it, your application could run out of memory and crash. If you want to react to flow control signals to prevent that, instead of using this class you can implement an object that conforms to GRXWriter.
Thread-safety: the methods of this class are thread-safe.
Definition at line 41 of file GRXBufferedPipe.h.
+ (instancetype) pipe |
Convenience constructor.