Source.unfoldResource
Wrap any resource that can be opened, queried for next element (in a blocking way) and closed using three distinct functions into a source.
Signature
def unfoldResource[T, S](create: () => S, read: (S) => Option[T], close: (S) => Unit): Source[T, NotUsed]
Description
Wrap any resource that can be opened, queried for next element (in a blocking way) and closed using three distinct functions into a source.
emits when there is demand and read function returns value
completes when read function returns None