More Related Content

Similar to .NET Fest 2018. Vagif Abilov. Akka + F# = Akkling(20)

More from NETFest(20)

.NET Fest 2018. Vagif Abilov. Akka + F# = Akkling

  1. Vagif Abilov Consultant at Miles Lives in Kolbotn, Norway Works with F# and C# @ooobject vagif.abilov@mail.com
  2. Distribution Engine CDN Media archives Program Metadata Queued commands
  3. Durable queue CDN Transport Command Dispatcher Durable queue Command Adapter Clustered Clustered Event Journal Clustered
  4. Why Akka.NET & F#?
  5. Akka.FSharp vs Akkling: metrics *) Akka.FSharp Akkling Latest version 1.3.9 0.9.3 Number of NuGet package downloads 28K 7K Number of commits 114 First: 09.07.2014 Last: 15.05.2018 155 First: 05.06.2015 Last: 16.07.2018 Commits in 2017-2018 2017: 11 2018: 7 2017: 41 2018: 35 *) 01.10.2018
  6. Akka.FSharp vs Akkling: features Akka.FSharp Akkling Idiomatic Akka.NET F# API: • Defining actors • Changing actor state (using mutually recursive F# functions to implement Become/Unbecome) • Defining persistent actors (clumsy API making persistent actors look very different and hard to customize) Idiomatic Akka.NET F# API: • Defining actors (almost like in officialAPI, but typed) • Changing actor state like in offical API • Redesigned persistent actors • Lifecycle event • Cluster sharding • Distributed data • Akka Streams
  7. let mkActor = spawn system "MyActor" <| fun mailbox -> let rec loop () = actor { let! message = mailbox.Receive() match message with | Greet(name) -> printfn "Hello %s" name | Hi -> printfn "Hello from F#!" return! loop () } loop ()
  8. let mkActor = spawnAnonymous system <| props (fun mailbox -> let rec loop () = actor { let! message = mailbox.Receive() match message with | Greet(name) -> printfn "Hello %s" name | Hi -> printfn "Hello from F#!" return! loop () } loop ())
  9. type ActorMessage = | Greet of string | Hi actor <! Hi actor <! Greet "Figaro” // Won’t work in Akkling! actor <! 2017
  10. File dispatcher File 1 File 2 File 3 File processor File processor Hash 1 Hash 2 File 1File 1 File 2 File 3 File processor File processorFile 3 File 2
  11. • Creating simple actors • Supervision • Lifecycle events • Actor persistence • Cluster sharding • Akka Streams All samples are available at https://github.com/object/akkling-net-fest
  12. MSUI52392934 MSUI52392934 KOID93746502 fg:msui52392934 fg:msui52392934 fg:koid93746502 Persistence ID Event Journal Entity 1 Entity 2
  13. Message Queue Message Parser MSUI52392934 MSUI52392934 KOID93746502 Entity 1 Entity 2
  14. Node 1 Shard region Shard region Shard 1 Shard 2 Node 2 Shard region Shard region Shard 3 Shard 4
  15. https://bit.ly/2E6by2a https://getakka.net https://github.com/Horusiath/Akkling https://github.com/object/akkling-net-fest
  16. Vagif Abilov Consultant at Miles Lives in Kolbotn, Norway @ooobject vagif.abilov@mail.com