deleteStream method
Delete a stream. The stream can not be used again.
Parameter name
identifies stream to truncate events
from. Use parameter expected
to indicate which stream
version that was last seen. Is used to perform consistency
checks based on optimistic locking
Implementation
@override
Future<void> deleteStream(
StreamName name,
ExpectedStreamVersion expected,
) async {
try {
await _anyOrNot(
expected,
whenAny: () => client.delete(StreamState.any(
name.value,
)),
otherwise: () => client.delete(StreamState.exists(
name.value,
revision: expected.asStreamRevision(),
)),
);
} on StreamNotFoundException {
throw $e.StreamNotFoundException(name);
}
}