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-05-29 17:00:48 +09:00
|
|
|
@ref[Source operators](../index.md#source-operators)
|
2018-04-18 11:44:37 +02:00
|
|
|
|
|
|
|
|
@@@div { .group-scala }
|
|
|
|
|
|
2018-04-18 10:26:53 +02:00
|
|
|
## Signature
|
|
|
|
|
|
2018-09-13 10:49:51 +02:00
|
|
|
@@signature [Source.scala](/akka-stream/src/main/scala/akka/stream/scaladsl/Source.scala) { #unfoldResourceAsync }
|
2018-04-18 11:44:37 +02:00
|
|
|
|
|
|
|
|
@@@
|
|
|
|
|
|
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
|
|
|
|
|
|
2019-10-04 15:46:05 +02:00
|
|
|
## Reactive Streams semantics
|
2018-04-18 10:26:53 +02:00
|
|
|
|
|
|
|
|
@@@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`
|
|
|
|
|
|
|
|
|
|
@@@
|
|
|
|
|
|