Module containing F#+ Extension Methods on existing types
Type extension | Description |
Full Usage:
Async.AsTask(computation, ?cancellationToken)
Parameters:
Async<'T>
-
The asynchronous computation to execute.
?cancellationToken : CancellationToken
-
The CancellationToken to associate with the computation.
The default is used if this parameter is not provided.
Returns: Task<'T>
A Task that will be completed
in the corresponding state once the computation terminates (produces the result, throws exception or gets canceled)
|
Runs an asynchronous computation, starting immediately on the current operating system thread, but also returns the execution as Task This behaves exactly like Async.StartImmediateAsTask but without unexpected exceptions-wrapping. If no cancellation token is provided then the default cancellation token is used. You may prefer using this method if you want to achive a similar behviour to async await in C# as async computation starts on the current thread with an ability to return a result.
Extended Type:
Example
val printfn: format: Printf.TextWriterFormat<'T> -> 'T
val t: obj
val async: AsyncBuilder
Multiple items
type Async = static member AsBeginEnd: computation: ('Arg -> Async<'T>) -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit) static member AwaitEvent: event: IEvent<'Del,'T> * ?cancelAction: (unit -> unit) -> Async<'T> (requires delegate and 'Del :> Delegate) static member AwaitIAsyncResult: iar: IAsyncResult * ?millisecondsTimeout: int -> Async<bool> static member AwaitTask: task: Task<'T> -> Async<'T> + 1 overload static member AwaitWaitHandle: waitHandle: WaitHandle * ?millisecondsTimeout: int -> Async<bool> static member CancelDefaultToken: unit -> unit static member Catch: computation: Async<'T> -> Async<Choice<'T,exn>> static member Choice: computations: Async<'T option> seq -> Async<'T option> static member FromBeginEnd: beginAction: (AsyncCallback * obj -> IAsyncResult) * endAction: (IAsyncResult -> 'T) * ?cancelAction: (unit -> unit) -> Async<'T> + 3 overloads static member FromContinuations: callback: (('T -> unit) * (exn -> unit) * (OperationCanceledException -> unit) -> unit) -> Async<'T> ... -------------------- type Async<'T> static member Async.Sleep: dueTime: System.TimeSpan -> Async<unit>
Prints "A", "B", "D" immediately, then "C", "E" in 1 second.
static member Async.Sleep: millisecondsDueTime: int -> Async<unit> |
Type extension | Description |
|
Prefer this over
Extended Type:
|
|
Prefer this over
Extended Type:
|
|
Extended Type:
|
|
Extended Type:
|
|
Extended Type:
|
|
Extended Type:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
Option.Sequential(t)
Parameters:
'T option seq
Returns: 'T seq option
|
|
Full Usage:
ValueOption.Sequential(t)
Parameters:
'T voption seq
Returns: 'T seq voption
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Full Usage:
Task.WhenAll(tasks, ?cancellationToken)
Parameters:
Task<'a>[]
?cancellationToken : CancellationToken
Returns: Task<'a[]>
|
Extended Type:
|