Git Product home page Git Product logo

cricket's Introduction

Issue Stats Issue Stats

Cricket NuGet Status

Cricket is an actor library. The actor programming model is inherently concurrent, an actor is a primitive that wraps a computation, the computation is ran by sending messages to the actor. The actor can then respond to the receipt of the message by executing one or more of the following actions (possibly concurrently),

  • Create a number of new actors
  • Send a another message to other actors
  • Change the behaviour to be used upon receipt of the next message.

Currently there are a couple of actor libraries on the .NET platform

  • AkkaDotNet - This is a port of the scala based actor framework Akka. This is written in C# but does have an F# API.
  • Orleans - This is a Microsoft research project aiming to simplfy the development of scalable cloud based services, with a high level of abstraction over the actor programming model.
  • F# Core - The FSharp.Core library actually has its own actor implementation in the form of the MailboxProcessor<'T> type.

Cricket in no way aims to be a clone of either of these however it does draw on the ideas in all of the above frameworks as well as Erlang and OTP. Cricket aims to be as simple and safe to use as possible hopefully making it very difficult for you to shoot or self in the foot.

Building

  • Simply build Cricket.sln in Visual Studio, Mono Develop, or Xamarin Studio. You can also use the FAKE script:

    • Windows: Run build.cmd
      • AppVeyor Build status
    • Mono: Run build.sh
      • Travis Build Status

Simple Example

#r "Cricket.dll"
open Cricket

ActorHost.Start()

type Say =
    | Hello
    | HelloWorld
    | Name of string

let greeter = 
    actor {
        name "greeter"
        body (
            let rec loop() = messageHandler {
                let! msg = Message.receive()

                match msg with
                | Hello ->  printfn "Hello"
                | HelloWorld -> printfn "Hello World"
                | Name name -> printfn "Hello, %s" name
                return! loop()

            }
            loop())
    } |> Actor.spawn

greeter <-- Name("from F# Actor") 

Maintainer(s)

The default maintainer account for projects under "fsprojects" is @fsprojectsgit - F# Community Project Incubation Space (repo management)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.