class MemorySink[A] extends Sink[A]{
private var buffer: Vector[A] = Vector.empty
def replay: Vector[A] = buffer
def last: Option[A] = buffer.lastOption
override def apply(a: A): Async[Unit] = Async {
buffer :+= a
}
}
Created
May 28, 2018 06:09
-
-
Save wjlow/df7cf9a5eb714f96f16ce5285fbd2a55 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment