Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

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

41 views

Published on

If you are convinced that actor model can drive your design of scalable and performant .NET applications, you will very likely give a chance to Akka.NET - a port of JVM Akka framework that gained popularity among .NET developers. And if you are fan of a functional programming, you will certainly try Akka.NET F# API. But which of them? There is an official one, but there is also an experimental one, called Akkling that offers typed actors and F# support for actor lifecycle, cluster sharding and reactive streams.
Come to this talk and you will be convinced that Akkling is the way to go!

Published in: Education
  • Be the first to comment

  • Be the first to like this

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

  1. 1. Vagif Abilov Consultant at Miles Lives in Kolbotn, Norway Works with F# and C# @ooobject vagif.abilov@mail.com
  2. 2. Distribution Engine CDN Media archives Program Metadata Queued commands
  3. 3. Durable queue CDN Transport Command Dispatcher Durable queue Command Adapter Clustered Clustered Event Journal Clustered
  4. 4. Why Akka.NET & F#?
  5. 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. 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. 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. 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. 9. type ActorMessage = | Greet of string | Hi actor <! Hi actor <! Greet "Figaro” // Won’t work in Akkling! actor <! 2017
  10. 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. 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. 12. MSUI52392934 MSUI52392934 KOID93746502 fg:msui52392934 fg:msui52392934 fg:koid93746502 Persistence ID Event Journal Entity 1 Entity 2
  13. 13. Message Queue Message Parser MSUI52392934 MSUI52392934 KOID93746502 Entity 1 Entity 2
  14. 14. Node 1 Shard region Shard region Shard 1 Shard 2 Node 2 Shard region Shard region Shard 3 Shard 4
  15. 15. https://bit.ly/2E6by2a https://getakka.net https://github.com/Horusiath/Akkling https://github.com/object/akkling-net-fest
  16. 16. Vagif Abilov Consultant at Miles Lives in Kolbotn, Norway @ooobject vagif.abilov@mail.com

×