EsNullStreamSink
Description
An <EsStreamSink> that discards all events.
The sink silently drops events until #close is called, at which point it raises <EsAsyncStateError>s when events are added. This is the same behavior as a sink whose remote end has closed, such as when a socket connection has been closed.
This can be used when a sink is needed but no events are actually intended to be added. The
<EsNullStreamSink> error creational methods can be used to represent errors when creating a sink, since
EsStreamSink>>done exposes sink errors. For example:
["<create sink>"] on: Exception do: [:ex | EsNullStreamSink error: 'error']
Instance State
done: <EsFuture>
closed: <Boolean>
addingStream: <EsStream>
Class Methods
<details> done:
<pre><code> Creates a null sink.
If @done is passed, it's used as the [EsStreamSink done] future. Otherwise, a
completed future is used.
Arguments:
done - <EsFuture>
Answers:
<EsNullStreamSink>
</code></pre> </details>
<details> error:
<pre><code> Creates a null sink whose done future emits an @error
Note that this error will not be considered uncaught.
Arguments:
error - <Object>
Answers:
<EsNullStreamSink>
</code></pre> </details>
<details> error:stackTrace:
<pre><code> Creates a null sink whose done future emits an @error
Note that this error will not be considered uncaught.
Arguments:
error - <Object>
stackTrace - <EsAsyncStackTrace>
Answers:
<EsNullStreamSink>
</code></pre> </details>
<details> new
<pre><code> Creates a null sink with a completed (with nil) future.
Answers:
<EsNullStreamSink>
</code></pre> </details>
Instance Methods
<details> add:
</details>
<details> addError:stackTrace:
</details>
<details> addStream:
</details>
<details> close
</details>
<details> done
</details>
Last modified date: 04/21/2022