Math.NET Numerics
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

60 lines
3.6 KiB

<HTML><HEAD><TITLE>Microsoft.FSharp.Control.AsyncExtensions</TITLE><link rel="stylesheet" type="text/css"href="../msdn.css"></link></HEAD><BODY>
<br><dl>
<dt></dt><dd>
<h1>[<a href='../namespaces.html'>Home</a>] Module <a href='Microsoft.FSharp.Control.html'>Microsoft.FSharp.Control</a>.AsyncExtensions </h1><br>
</dd>
<dt></dt><dd>
<table>
<tr valign='top'><td><summary>
Extensions to the F# Microsoft.FSharp.Control.Async module
</summary>
<dt><h3>Extension Members</h3></dt><dd>
<table width="100%%">
<tr><th width=60%>Extension Member</th><th>Description</th></tr>
<tr valign="top"><td><pre>member
AsBeginEnd : computation:<a href='../FSharp.Core/Microsoft.FSharp.Control.type_Async-1.html'>Async</a>&lt;'T&gt; ->
(<a href='http://msdn2.microsoft.com/en-us/library/System.AsyncCallback.aspx'>AsyncCallback</a> * <a href='../FSharp.Core/Microsoft.FSharp.Core.type__obj.html'>obj</a> -> <a href='http://msdn2.microsoft.com/en-us/library/System.IAsyncResult.aspx'>IAsyncResult</a>) * (<a href='http://msdn2.microsoft.com/en-us/library/System.IAsyncResult.aspx'>IAsyncResult</a> -> 'T) *
(<a href='http://msdn2.microsoft.com/en-us/library/System.IAsyncResult.aspx'>IAsyncResult</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__unit.html'>unit</a>)</pre></td><td><summary>
Return three functions that can be used to implement the .NET Asynchronous
Programming Model (APM) for a given asynchronous computation.
The functions should normally be published as members with prefix 'Begin',
'End' and 'Cancel', and can be used within a type definition as follows:
<tt>
let beginAction,endAction,cancelAction = Async.AsBeginEnd computation
member x.BeginSomeOperation(callback,state) = beginAction(callback,state)
member x.EndSomeOperation(iar) = endAction(iar)
member x.CancelSomeOperation(iar) = cancelAction(iar)
</tt>
The resulting API will be familiar to programmers in other .NET languages and
is a useful way to publish asynchronous computations in .NET components.
</summary></td></tr>
<tr valign="top"><td><pre>member
AwaitEvent : <a href='../FSharp.Core/Microsoft.FSharp.Control.type_IEvent-2.html'>IEvent</a>&lt;'Delegate,'T&gt; * ?cancelAction:(<a href='../FSharp.Core/Microsoft.FSharp.Core.type__unit.html'>unit</a> -> <a href='../FSharp.Core/Microsoft.FSharp.Core.type__unit.html'>unit</a>) ->
<a href='../FSharp.Core/Microsoft.FSharp.Control.type_Async-1.html'>Async</a>&lt;'T&gt; (requires delegate and 'Delegate :> <a href='http://msdn2.microsoft.com/en-us/library/System.Delegate.aspx'>Delegate</a>)</pre></td><td><summary>
Return an asynchronous computation that waits for a single invocation of a .NET event by
internally adding a handler to the event. Once the computation completes or is cancelled, the
handler is removed from the event.
The computation will respond to cancellation while waiting for the completion
of the operation. If 'cancelAction' is specified, cancellation causes the given
function to be executed. The computation then continues to wait for the event.
If 'cancelAction' is not specified, then cancellation causes the computation
to stop immediately, and if the event is subsequently raised it may
be ignored.
</summary></td></tr>
</table>
</dd>
</td></tr>
<tr valign='top'><td>
<dt><h3>See Also</h3></dt><dd>
<a href="Microsoft.FSharp.Control.html">Microsoft.FSharp.Control</a> </dd>
</td></tr>
</table>
</dd>
</dl>
<br /> <br/><p><i>Documentation for assembly FSharp.PowerPack, version 1.9.6.16, generated using <a href='http://research.microsoft.com/fsharp/'>F# Programming Language</a> version 1.9.6.16</i></p>
</BODY></HTML>