Last active
August 29, 2015 14:15
-
-
Save Thorium/c64b8c5bd105f4f53d1e to your computer and use it in GitHub Desktop.
Getting started with Akka.NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create Console-application, then NuGet: Install-Package Akka | |
module AkkaConsoleApplication | |
open Akka | |
open Akka.Actor | |
type Greet(who) = | |
member x.Who = who | |
type GreetingActor() as g = | |
inherit ReceiveActor() | |
do g.Receive<Greet>(fun (greet:Greet) -> printfn "Hello %s" greet.Who) | |
[<EntryPoint>] // Works also from F#-Interactive. | |
let main argv = // More details: http://getakka.net/docs/Getting%20started | |
let system = ActorSystem.Create "MySystem" | |
let greeter = system.ActorOf<GreetingActor> "greeter" | |
"World" |> Greet |> greeter.Tell | |
System.Console.ReadLine() |> ignore | |
0 // return an integer exit code |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment