Snippets tagged MailboxProcessor

  • Web Crawler

    This snippet features an F# Web crawler that i'm already using in 2 applications (slightly modified). It's based on a scalable network of communicating agents that follow URLs extracted from HTML pages until reaching the specified limit.

    20 people like this
    Posted: 1 years ago by Taha Hachana

  • Actors acting as Lambdas

    The Untyped Lambda Calculus encoded as actors (F#'s MailboxProcessors)

    2 people like this
    Posted: 1 years ago by Nick Palladinos

  • Web Crawler extensions

    The snippet extends a web crawler from snippet http://fssnip.net/3K. It synchronizes all printing using an additional agent (so printed text does not interleave) and the crawling function returns an asynchronous workflow that returns when crawling completes.

    6 people like this
    Posted: 10 months ago by Tomas Petricek

  • Cancellable agent

    The snippet implements a wrapper for standard F# agent that can be cancelled using the IDisposable interface. This makes it possible to use the agent locally (e.g. inside asynchronous workflow). When it is no longer needed, the agent's body is cancelled.

    8 people like this
    Posted: 10 months ago by Tomas Petricek

  • Agent Based Scheduler

    An agent based scheduler, can be sent a single schedule message (ScheduleOnce) and multiple schedule message (Schedule). The schedule messages comprise of a function to receive the message, the message, an initial TimeSpan before the message is scheduled, and another timespan for the schedule repeat. Check out my blog below for more details: http://bit.ly/mK4prb

    4 people like this
    Posted: 10 months ago by 7sharp9

  • Simple job processor

    Generic batch job processor using Mail box processor. Sending quit message using PostAndReply will ensure that all jobs are completed before returning. (Exception handling is responsibility of the job)

    4 people like this
    Posted: 9 months ago by Ankur Dhama

  • Throttling agent

    Agent that can be used for controlling the number of concurrently executing asynchronous workflows. The agent runs a specified number of operations concurrently and queues remaining pending requests. The queued work items are started as soon as one of the previous items completes.

    9 people like this
    Posted: 11 months ago by Tomas Petricek

  • Simple timed-expiry cache

    Basic thread-safe timed-expiry cache, implemented as a MailboxProcessor.

    3 people like this
    Posted: 6 months ago by Yusuf Motara

  • The dining philosophers

    The dining philosophers problem implemented using a waiter.

    4 people like this
    Posted: 6 months ago by Alex Muscar

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

    3 people like this
    Posted: 4 months ago by Tomas Petricek

  • Fun with Ping and Pong

    Yet another ping pong sample with agents.

    3 people like this
    Posted: 22 days ago by Ryan Riley

  • Ping and Pong go Chunking Along

    Parameterizing pong allows us to do even more fun things. Here we use a few message types to allow stateful consumption of data sent by ping to its pongs.

    1 people like this
    Posted: 21 days ago by Ryan Riley