These are chat archives for akkadotnet/akka.net

16th
Apr 2017
Weston
@ronnyek
Apr 16 2017 04:05
so if I want to build a console app, and have it connect or share an actorsystem with a webapp
is that clustering and requiring lighthouse?
Chris Ochs
@gamemachine
Apr 16 2017 07:48
if both have static ip's and can reach each other, I don't see a reason for lighthouse really. just put the addresses of both as the seed nodes in both apps
or same address different ports that works also
Arjen Smits
@Danthar
Apr 16 2017 15:34
@ronnyek at the very least that you would need akka.remote. You can create an server/client or peer to peer connection with akka.remote manually
akka.clustering layers on top of akka.remote and adds service discoverability and reliability things that would expect from a full blown cluster
Weston
@ronnyek
Apr 16 2017 16:00
Ok...
I think I'll do that and add clustering later... Need to simplify this project for experimentation
Remove variables until I am familiar with and comfortable with Akka.net
Tomasz Jaskula
@tjaskula
Apr 16 2017 17:11
Is this the only way defining parent/child relationship with FSharp API ? cc: @Horusiath
let playback = 
        spawn system "Playback"
        <| fun parentMailbox ->
            let child = 
                spawn parentMailbox "child" 
                    <| fun childMailbox ->
                        childMailbox.Defer (fun () -> printfn "Child stopping")
                        printfn "Child started"
                        let rec childLoop() = actor {
                            let! msg = childMailbox.Receive()
                            return! childLoop()
                        }
                        childLoop()
            cprintfn ConsoleColor.Gray "Creating parent actor..."
            // define parent behavior
            let rec loop() = actor {
                let! msg = parentMailbox.Receive()
                child.Forward(msg)  // forward all messages through
                return! loop ()
            }
            loop ()
Bartosz Sypytkowski
@Horusiath
Apr 16 2017 19:41
@tjaskula using Akka.FSharp? Yes. But in normal conditions you'd probably move child behavior to separate function