toFlow

fun <E> EventSource<E>.toFlow(): Flow<E>

Create a Flow that emits each E from this EventSource.

EventSource.subscribe is called when collection begins and Disposable.dispose is called when the Flow is cancelled.