Snippets tagged asynchronous workflows
Asynchronous Controller Helper
The snippet declares a helper for creating asynchronous controllers for ASP.NET MVC 3. It declares a new base class for asynchronous actions that exposes a computation builder for writing actions using F# asynchronous workflows.
7 people like this
Posted: 1 years ago by Tomas PetricekAsynchronous Workflow Controller
The snippet overrides default AsyncControllerActionInvoker so F# async workflows can be used for ASP.NET MVC 3. It declares a new base class for asynchronous controller. Controller method has to have return type Async<ActionResult>.
3 people like this
Posted: 11 months ago by Dmitry MorozovExtensions for HTTP servers
This snippet extends several types from the System.Net namespace. It provides an easy to use API for creating asynchronous (as well as synchronous) HTTP servers using F# asynchronous workflows.
3 people like this
Posted: 10 months ago by Tomas PetricekCreating observable using Async.StartDisposable
Implements a simple Async.StartDisposable extension that can be used to easily create IObservable values from F# asynchronous workflows. The method starts an asynchronous workflow and returns IDisposable that cancels the workflow when disposed.
4 people like this
Posted: 8 months ago by Tomas Petricek
Async.Choose operation
Non-deterministic choice operation for F# asynchronous workflows - creates a workflow that returns the result of one of two asynchronous workflows, depending on which completes first. (The other workflow is not cancelled.)
3 people like this
Posted: 7 months ago by Tomas PetricekReturn the first result using Async.Choice
The snippet implements Async.Choice method that takes several workflows and creates a workflow, which returns the first result that was computed. After a workflow completes, remaining workflows are cancelled using the F# async cancellation mechanism. (The method doesn't handle exceptions.)
6 people like this
Posted: 9 months ago by Tomas PetricekF# counter agent
The snippet shows a simple F# agent that calculates average from the received values. It supports one message for adding numbers to the statistics and one for resetting the state. Moreover, the agent limits the processing rate to 1 message per second.
3 people like this
Posted: 4 months ago by Tomas Petricek