2018-04-18 11:44:37 +02:00
|
|
|
# Source.unfoldResourceAsync
|
2018-04-18 10:26:53 +02:00
|
|
|
|
|
|
|
|
Wrap any resource that can be opened, queried for next element (in a blocking way) and closed using three distinct functions into a source.
|
|
|
|
|
|
2018-04-18 11:44:37 +02:00
|
|
|
@ref[Source stages](../index.md#source-stages)
|
|
|
|
|
|
|
|
|
|
@@@div { .group-scala }
|
|
|
|
|
|
2018-04-18 10:26:53 +02:00
|
|
|
## Signature
|
|
|
|
|
|
2018-04-18 11:44:37 +02:00
|
|
|
@@signature [Source.scala]($akka$/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala) { #unfoldResourceAsync }
|
|
|
|
|
|
|
|
|
|
@@@
|
|
|
|
|
|
2018-04-18 10:26:53 +02:00
|
|
|
## 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.
|
|
|
|
|
Functions return @scala[`Future`] @java[`CompletionStage`] to achieve asynchronous processing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@@div { .callout }
|
|
|
|
|
|
|
|
|
|
**emits** when there is demand and @scala[`Future`] @java[`CompletionStage`] from read function returns value
|
|
|
|
|
|
|
|
|
|
**completes** when @scala[`Future`] @java[`CompletionStage`] from read function returns `None`
|
|
|
|
|
|
|
|
|
|
@@@
|
|
|
|
|
|