Click or drag to resize
Akka.NETSourceUnfoldTState, TElem Method
Create a SourceTOut, TMat that will unfold a value of type TState into a pair of the next state TState and output elements of type TElem.

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> Unfold<TState, TElem>(
	TState state,
	Func<TState, Tuple<TState, TElem>> unfold
)

Parameters

state
Type: TState
TBD
unfold
Type: SystemFuncTState, TupleTState, TElem
TBD

Type Parameters

TState
TBD
TElem
TBD

Return Value

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