FSharp.Data.GraphQL


AsyncVal

Namespace: FSharp.Data.GraphQL

Functions and values

Function or valueDescription
bind(binder x)
Signature: binder:('T -> AsyncVal<'U>) -> x:AsyncVal<'T> -> AsyncVal<'U>
Type parameters: 'T, 'U

Binds AsyncVal using binder function to produce new AsyncVal.

collectParallel(values)
Signature: values:AsyncVal<'T> [] -> AsyncVal<'T []>
Type parameters: 'T

Converts array of AsyncVals into AsyncVal with array results. In case when are non-immediate values in provided array, they are executed all in parallel, in unordered fashion. Order of values inside returned array is maintained.

collectSequential(values)
Signature: values:AsyncVal<'T> [] -> AsyncVal<'T []>
Type parameters: 'T

Converts array of AsyncVals into AsyncVal with array results. In case when are non-immediate values in provided array, they are executed asynchronously, one by one with regard to their order in array. Returned array maintain order of values.

empty
Signature: AsyncVal<'T>
Type parameters: 'T

Returns an empty AsyncVal with immediatelly executed value.

fold(fn zero x)
Signature: fn:('State -> 'T -> 'State) -> zero:'State -> x:AsyncVal<'T> -> AsyncVal<'State>
Type parameters: 'State, 'T

Folds content of AsyncVal over provided initial state zero using provided fn. Returns new AsyncVal as a result.

get(x)
Signature: x:AsyncVal<'T> -> 'T
Type parameters: 'T

Returns value wrapped by current AsyncVal. If it's part of Async computation, it's executed synchronously and then value is returned.

isAsync(x)
Signature: x:AsyncVal<'T> -> bool
Type parameters: 'T

Returns true if AsyncVal wraps an Async computation, otherwise false.

isSync(x)
Signature: x:AsyncVal<'T> -> bool
Type parameters: 'T

Returns true if AsyncVal contains immediate result, otherwise false.

map(fn x)
Signature: fn:('T -> 'U) -> x:AsyncVal<'T> -> AsyncVal<'U>
Type parameters: 'T, 'U

Maps content of AsyncVal using provided mapping function, returning new AsyncVal as the result.

ofAsync(a)
Signature: a:Async<'T> -> AsyncVal<'T>
Type parameters: 'T

Create new AsyncVal from Async computation.

rescue(fn x)
Signature: fn:(exn -> 'T) -> x:AsyncVal<'T> -> AsyncVal<'T>
Type parameters: 'T

Applies rescue fn in case when contained Async value throws an exception.

toAsync(x)
Signature: x:AsyncVal<'T> -> Async<'T>
Type parameters: 'T

Converts AsyncVal to Async computation.

wrap(v)
Signature: v:'T -> AsyncVal<'T>
Type parameters: 'T

Returns an AsyncVal wrapper around provided Async computation.

Fork me on GitHub