FSharpx.Extras


Task

Namespace: FSharpx

Nested types and modules

TypeDescription
Result<'T>

Task result

TaskBuilder
TaskBuilderWithToken
TokenToTask<'a>

Functions and values

Function or valueDescription
( *> ) a b
Signature: a:Task<'?7980> -> b:Task<'?7981> -> Task<'?7981>
Type parameters: '?7980, '?7981

Sequence actions, discarding the value of the first argument.

CompiledName: op_MultiplyGreater

( <!> ) f x
Signature: f:('?7977 -> '?7978) -> x:Task<'?7977> -> Task<'?7978>
Type parameters: '?7977, '?7978

Infix map

CompiledName: op_LessBangGreater

( <* ) a b
Signature: a:Task<'?7983> -> b:Task<'?7984> -> Task<'?7983>
Type parameters: '?7983, '?7984

Sequence actions, discarding the value of the second argument.

CompiledName: op_LessMultiply

( <*> ) f x
Signature: f:Task<('?7974 -> '?7975)> -> x:Task<'?7974> -> Task<'?7975>
Type parameters: '?7974, '?7975

Sequential application

CompiledName: op_LessMultiplyGreater

( <=< ) x
Signature: x:('?7962 -> Task<'?7963>) -> ('?7964 -> '?7965) -> '?7964 -> Task<'?7963>
Type parameters: '?7962, '?7963, '?7964, '?7965

Right-to-left Kleisli composition

CompiledName: op_LessEqualsLess

( =<< ) f m
Signature: f:('?7951 -> Task<'?7952>) -> m:Task<'?7951> -> Task<'?7952>
Type parameters: '?7951, '?7952

Flipped >>=

CompiledName: op_EqualsLessLess

( >=> ) f g x
Signature: f:('?7957 -> '?7958) -> g:('?7959 -> Task<'?7960>) -> x:'?7957 -> Task<'?7960>
Type parameters: '?7957, '?7958, '?7959, '?7960

Left-to-right Kleisli composition

CompiledName: op_GreaterEqualsGreater

( >>. ) m1 m2
Signature: m1:Task<'?7954> -> m2:Task<'?7955> -> Task<'?7955>
Type parameters: '?7954, '?7955

Sequentially compose two either actions, discarding any value produced by the first

CompiledName: op_GreaterGreaterDot

( >>= ) m f
Signature: m:Task<'?7948> -> f:('?7948 -> Task<'?7949>) -> Task<'?7949>
Type parameters: '?7948, '?7949

Sequentially compose two actions, passing any value produced by the first as an argument to the second.

CompiledName: op_GreaterGreaterEquals

ap x f
Signature: x:Task<'?7971> -> f:Task<('?7971 -> '?7972)> -> Task<'?7972>
Type parameters: '?7971, '?7972

Sequential application

bind f m
Signature: f:('T -> Task<'U>) -> m:Task<'T> -> Task<'U>
Type parameters: 'T, 'U
bindWithOptions (...)
Signature: token:CancellationToken -> continuationOptions:TaskContinuationOptions -> scheduler:TaskScheduler -> f:('T -> Task<'U>) -> m:Task<'T> -> Task<'U>
Type parameters: 'T, 'U
Catch t
Signature: t:Task<'a> -> Task<Choice<'a,exn>>
Type parameters: 'a

Creates a task that executes a specified task. If this task completes successfully, then this function returns Choice1Of2 with the returned value. If this task raises an exception before it completes then return Choice2Of2 with the raised exception.

foldM f s
Signature: f:('?7986 -> '?7987 -> Task<'?7986>) -> s:'?7986 -> seq<'?7987> -> Task<'?7986>
Type parameters: '?7986, '?7987
Ignore t
Signature: t:Task<'?8057> -> Task<unit>
Type parameters: '?8057

Creates a task that runs the given task and ignores its result.

lift2 f a b
Signature: f:('?7967 -> '?7968 -> '?7969) -> a:Task<'?7967> -> b:Task<'?7968> -> Task<'?7969>
Type parameters: '?7967, '?7968, '?7969

Promote a function to a monad/applicative, scanning the monadic/applicative arguments from left to right.

map f m
Signature: f:('?7937 -> '?7938) -> m:Task<'?7937> -> Task<'?7938>
Type parameters: '?7937, '?7938

Transforms a Task's first value by using a specified mapping function.

mapM f x
Signature: f:('?7991 -> Task<'?7992>) -> x:'?7991 list -> Task<'?7992 list>
Type parameters: '?7991, '?7992
mapWithOptions (...)
Signature: token:CancellationToken -> continuationOptions:TaskContinuationOptions -> scheduler:TaskScheduler -> f:('?7934 -> '?7935) -> m:Task<'?7934> -> Task<'?7935>
Type parameters: '?7934, '?7935

Transforms a Task's first value by using a specified mapping function.

Parallel tasks
Signature: tasks:seq<(unit -> Task<'a>)> -> Task<'a []>
Type parameters: 'a

Creates a task that executes all the given tasks.

ParallelCatch tasks
Signature: tasks:seq<(unit -> Task<'a>)> -> Task<Choice<'a,exn> []>
Type parameters: 'a

Creates a task that executes all the given tasks. This function doesn't throw exceptions, but instead returns an array of Choices.

ParallelCatchWithThrottle throttle tasks
Signature: throttle:int -> tasks:seq<(unit -> Task<'a>)> -> Task<Choice<'a,exn> []>
Type parameters: 'a

Creates a task that executes all the given tasks. This function doesn't throw exceptions, but instead returns an array of Choices. The paralelism is throttled, so that at most throttle tasks run at one time.

ParallelWithThrottle throttle tasks
Signature: throttle:int -> tasks:seq<(unit -> Task<'a>)> -> Task<'a []>
Type parameters: 'a

Creates a task that executes all the given tasks. The paralelism is throttled, so that at most throttle tasks run at one time.

returnM a
Signature: a:'?7946 -> Task<'?7946>
Type parameters: '?7946
run t
Signature: t:(unit -> Task<'?7930>) -> Result<'?7930>
Type parameters: '?7930
sequence s
Signature: s:Task<'a> list -> Task<'a list>
Type parameters: 'a
task
Signature: TaskBuilder
toAsync t
Signature: t:Task<'T> -> Async<'T>
Type parameters: 'T
ToTaskUnit t
Signature: t:Task -> Task<unit>

Converts a Task into Task

WhenAllUnits units
Signature: units:seq<Task<unit>> -> Task<unit>

Creates a single Task that will complete when all of the Task objects in an enumerable collection have completed.

Active patterns

Active patternDescription
( |AggregateExn|_| ) e
Signature: e:exn -> exn list option

Active pattern that matches on flattened inner exceptions in an AggregateException

CompiledName: |AggregateExn|_|

Fork me on GitHub