Experimental / work in progress.
Fable.Actor is an actor library for F# on .NET, JavaScript, Python and BEAM.
Write message loops with actor { }, keep state inside each actor, and communicate
through typed messages. BEAM uses native processes; other targets use
MailboxProcessor.
open Fable.Actor
let greeter =
Actor.spawn (fun inbox ->
let rec loop () = actor {
let! name = inbox.Receive()
printfn "Hello, %s!" name
return! loop ()
}
loop ())
Actor.send greeter "World"Start with Getting started, then follow the documentation guide:
- One actor API: choose a loop, state handler or command handler.
- Messaging: state, requests, deadlines and timers.
- Supervision: linked children and restart policies.
- Commands: optional state handlers with linked finite work.
- Lifetimes: optional cooperative shutdown and owned cleanup, using the same builder and NuGet package.
- Platform notes: portability and runtime limits.
- Development: build, test and run the examples.
Use messages rather than shared mutable state: on BEAM, actors have separate heaps and captured values are copied.
MIT licensed. Built with Fable and Fable.Beam.