Click or drag to resize
Akka.NETSourceUnfoldAsyncTState, TElem Method

Namespace:  Akka.Streams.Dsl
Assembly:  Akka.Streams (in Akka.Streams.dll) Version: 1.2.3.42 (1.2.3.42)
Syntax
public static Source<TElem, NotUsed> UnfoldAsync<TState, TElem>(
	TState state,
	Func<TState, Task<Tuple<TState, TElem>>> unfoldAsync
)

Parameters

state
Type: TState
TBD
unfoldAsync
Type: SystemFuncTState, TaskTupleTState, TElem
TBD

Type Parameters

TState
TBD
TElem
TBD

Return Value

Type: SourceTElem, NotUsed
TBD
Examples
For example, all the Fibonacci numbers under 10M:
Source.unfoldAsync(01) {
 case (a, _) if a > 10000000 ⇒ Future.successful(None)
 case (a, b) ⇒ Future{
   Thread.sleep(1000)
   Some((b → (a + b)) → a)
 }
}
See Also