ALL_OR_NOTHING | An ALL_OR_NOTHING Writer will either write all the data provided if it can do so without overwriting unconsumed data, or it will return Error::WOULDBLOCK without writing any data at all.
- Note
- : If there are no
Readers attached, data can be written to a ShardDataStream until it fills up, but it will then stop accepting data from an ALL_OR_NOTHING Writer until a Reader attaches and consumes some of the data. However, there is a corner case where a Reader is attached, but has seek()ed into the future. In this scenario, all data written until the Writer catches up with the Reader will never be consumed, so the SharedDataStream will allow an ALL_OR_NOTHING Writer to continue writing new data (and discarding old data) until it reaches the index the Reader is waiting for.
|
BLOCKING | A BLOCKING Writer will wait for up to the specified timeout (or forever if (timeout == 0) ) for space to become available. As soon as at least one word can be written, the Writer will write as many words as it can without overwriting unconsumed data, and return the number of words written. If no space becomes available in the specified timeout, a BLOCKING Writer will return Error::TIMEDOUT .
|