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.

    8 people like this

    Posted: 12 years ago by Tomas Petricek

  • Extensions 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.

    4 people like this

    Posted: 12 years ago by Tomas Petricek

  • Creating 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: 12 years ago by Tomas Petricek

  • F# 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.

    5 people like this

    Posted: 12 years ago by Tomas Petricek

  • Asynchronous 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.

    5 people like this

    Posted: 12 years ago by Dmitry Morozov

  • Return 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.)

    7 people like this

    Posted: 12 years 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.)

    4 people like this

    Posted: 12 years ago by Tomas Petricek

  • Async vs sync benchmark

    Quick benchmark to compare the throughput performance of F# MailboxProcessor using asynchronous workflows and a synchronous agent using a lock and busy loop. The latter is 9x faster on this machine.

    3 people like this

    Posted: 5 years ago by Jon Harrop