FSharpx.Async


AsyncStream

Namespace: FSharpx.Control

Operations on async streams.

Functions and values

Function or valueDescription
chooseAsync f s
Signature: f:('a -> Async<'b option>) -> s:AsyncStream<'a> -> AsyncStream<'b>
Type parameters: 'a, 'b

Filters and maps a stream using the specified choose function.

create hd tl
Signature: hd:'?7741 -> tl:AsyncStream<'?7741> -> Async<AsyncStreamNode<'?7741>>
Type parameters: '?7741

Creates an async stream given a head and tail.

cycleList xs
Signature: xs:'a list -> AsyncStream<'a>
Type parameters: 'a

Returns infinite repetition of the specified list.

distributeList xs
Signature: xs:AsyncStream<'a> list -> AsyncStream<'a list>
Type parameters: 'a

Takes a list of streams and produces a stream of lists.

drop n s
Signature: n:int -> s:AsyncStream<'a> -> AsyncStream<'a>
Type parameters: 'a

Drops the first n items from the stream.

filterAsync p s
Signature: p:('a -> Async<bool>) -> s:AsyncStream<'a> -> AsyncStream<'a>
Type parameters: 'a

Filters a stream based on the specified predicate.

head s
Signature: s:AsyncStream<'a> -> Async<'a>
Type parameters: 'a

Returns the first element of the stream.

iterAsync f s
Signature: f:('a -> Async<unit>) -> s:AsyncStream<'a> -> Async<unit>
Type parameters: 'a

Creates a computation which applies the function f to elements of the stream forever.

iterate f a
Signature: f:('a -> 'a) -> a:'a -> AsyncStream<'a>
Type parameters: 'a

Produces the infinite sequence of repeated applications of f.

mapAsync f s
Signature: f:('a -> Async<'b>) -> s:AsyncStream<'a> -> AsyncStream<'b>
Type parameters: 'a, 'b

Maps a function over an async stream.

mapAsyncSeq f s
Signature: f:('a -> AsyncSeq<'b>) -> s:AsyncStream<'a> -> AsyncStream<'b>
Type parameters: 'a, 'b

Maps each element of an async stream onto an async sequences returning a stream containing consecutive elements of the genereated async sequences.

prefixAsyncSeq s a
Signature: s:AsyncSeq<'a> -> a:AsyncStream<'a> -> AsyncStream<'a>
Type parameters: 'a

Prepends an async sequence to a stream.

prefixList xs a
Signature: xs:'a list -> a:AsyncStream<'a> -> AsyncStream<'a>
Type parameters: 'a

Prepends a list to a stream.

repeat a
Signature: a:'a -> AsyncStream<'a>
Type parameters: 'a

Creates an async stream which repeatedly returns the provided value.

scanAsync f z s
Signature: f:('a -> 'b -> Async<'b>) -> z:'b -> s:AsyncStream<'a> -> AsyncStream<'b>
Type parameters: 'a, 'b

Scans the stream applying the specified function to consecutive elements and returning the stream of results.

splitAtList n s
Signature: n:int -> s:AsyncStream<'a> -> Async<'a list * AsyncStream<'a>>
Type parameters: 'a

Returns a pair consisting of the prefix of the stream of the specified length and the remaining stream immediately following this prefix.

tail s
Signature: s:AsyncStream<'a> -> AsyncStream<'a>
Type parameters: 'a

Creates a stream which skips the first element of the provided stream.

tails s
Signature: s:AsyncStream<'a> -> AsyncStream<AsyncStream<'a>>
Type parameters: 'a

Creates a stream of tails of the specified stream.

take n s
Signature: n:int -> s:AsyncStream<'a> -> AsyncSeq<'a>
Type parameters: 'a

Creates an async sequence which iterates through the first n elements from the stream.

takeWhileAsync p s
Signature: p:('a -> Async<bool>) -> s:AsyncStream<'a> -> AsyncSeq<'a>
Type parameters: 'a

Takes elements from the stream until the specified predicate is no longer satisfied.

toAsyncSeq s
Signature: s:AsyncStream<'a> -> AsyncSeq<'a>
Type parameters: 'a

Creates an infinite async sequence from the stream.

unfoldAsync f z
Signature: f:('s -> Async<'a * 's>) -> z:'s -> AsyncStream<'a>
Type parameters: 's, 'a

Generates an async stream.

zip a b
Signature: a:AsyncStream<'a> -> b:AsyncStream<'b> -> AsyncStream<'a * 'b>
Type parameters: 'a, 'b

Zips two streams into a stream of pairs.

zipWith f a b
Signature: f:('a -> 'b -> 'c) -> a:AsyncStream<'a> -> b:AsyncStream<'b> -> AsyncStream<'c>
Type parameters: 'a, 'b, 'c

Zips two streams using the specified function.

Fork me on GitHub