Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 20 17:25
    valdisz synchronize #3889
  • Oct 20 17:17
    valdisz synchronize #3889
  • Oct 20 15:44
    valdisz synchronize #3889
  • Oct 20 09:22
    ismaelhamed commented #3863
  • Oct 19 23:39
    valdisz synchronize #3889
  • Oct 19 23:08
    edvinasz commented #2947
  • Oct 19 13:36
    Aaronontheweb commented #3973
  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3995
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump BenchmarkDotNet from 0.10.… (compare)

  • Oct 19 13:34
    dependabot-preview[bot] edited #3995
  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3993
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump Google.Protobuf from 3.9.1… (compare)

  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3991
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump Microsoft.Extensions.Depen… (compare)

  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3989
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump ApiApprover from 3.0.1 to … (compare)

  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3992
  • Oct 19 13:34
    dependabot-preview[bot] edited #3993
  • Oct 19 13:34
    dependabot-preview[bot] synchronize #3985
  • Oct 19 13:34

    dependabot-preview[bot] on nuget

    Bump System.Reflection.Emit fro… (compare)

Bartosz Sypytkowski
@Horusiath
why you thing that handling Terminated is more complex?
Christian Duhard
@cduhard
there is a disconnect here
i need to know when all of them are terminated
i can't do anything until that happems
*happens
they terminate without the app being in shutdown
Bartosz Sypytkowski
@Horusiath
...
  // normal receive
  message.Match()
  .With<Shutdown>(shutdown =>{
    var accounts = Context.GetChildren().Select(aref => aref.Path.Name.Contains("account")).ToArray();
    foreach(var account in accounts) account.Tell(shutdown);
    Become(WaitingForTermination(accounts.Length))
  });
}

public Receive WaitingForTermination(int counter) {
  var remaining = counter;
  return message => message.Match()
    .With<Terminated>(terminated => {
        if(terminated.ActorRef.Path.Name.Contains("account"))
          remaining--;
        if(remaining == 0)
          AllAccountsTerminated();
    })
    .WasHandled;
}
Christian Duhard
@cduhard
yeah, we were almost identical except I would just poll which is shite, but i was ok with it. My solution requires no changes to the Persistent actor with the down side of a timer
@Horusiath thanks a lot though. I am the only one doing message based work here, I have no one to bounce this stuff off of
Bartosz Sypytkowski
@Horusiath
no problem :)
Christian Duhard
@cduhard
do you have tests for that code?
j/k ;)
@Horusiath regarding your sharding persistence app, the intention is for you sagas to continue on restart correct?
Bartosz Sypytkowski
@Horusiath
at some point, once it will be finished
Christian Duhard
@cduhard
that's cool, i wanted to do that, but didn't have the time to reason through it. your sample makes it straightforward
Bartosz Sypytkowski
@Horusiath
sagas are hard once you apply "what if something will crash at any point in time" approach
Christian Duhard
@cduhard
yes they are, that's where I said, maybe later
can I use become from ActorBase?
Bartosz Sypytkowski
@Horusiath
yes
Christian Duhard
@cduhard
Used the same way? I only have an override of Receive.
Bartosz Sypytkowski
@Horusiath
Context.Become with Receive delegate
Christian Duhard
@cduhard
Context.Become(WaitingForTermination(accounts.Length));
Bartosz Sypytkowski
@Horusiath
yes
but if your have actor based on ReceiverActor or it's persistent version, you won't need much to adjust the sample to work with
Christian Duhard
@cduhard
is there any reason to use this style over Match?
                else if (message is Shutdown)
                {        
            var m = message as Shutdown;
Bartosz Sypytkowski
@Horusiath
no, just convinience
Christian Duhard
@cduhard
i just left some of it from your original sample. I much prefer Match syntax
Bartosz Sypytkowski
@Horusiath
with C# 7 we'll have pattern matching, and all of this will be part of language syntax
Christian Duhard
@cduhard
i was just going to say we need pattern matching
not sure why they didn;t include it in 6
so C# is becoming scala with readable syntax
Bartosz Sypytkowski
@Horusiath
still far from it ;) less expressive type system, no macros etc. also less "magic" ;)
Christian Duhard
@cduhard
i don't like scala syntax
it feels like a mess
Bartosz Sypytkowski
@Horusiath
some parts are nice, some are wtf
like with almost any language
Christian Duhard
@cduhard
the nice things about C# is they've done a pretty good job adding cool language features relatively cleanly
some better shorthand for list manipulation would be nice
they should also alias standard things like map, fold etc
Christian Duhard
@cduhard
This message was deleted
ignore that
Become drrr
to11mtm
@to11mtm
@Horusiath : True, but sometimes guidelines from a library help with Bureaucracy =)
Bartosz Sypytkowski
@Horusiath
@to11mtm true, we wanted to warn people using default serializer, that's why from the next release if you have json.net serializer configured as default, you'll receive warning, that it's going to be obsoleted after v1.5
I feel bad about rellying on default serializer for persistence. Some persistence libs already avoided that, providing their own defaults
to11mtm
@to11mtm
...speaking of... are there any Oracle Persistence libraries out there that anyone is aware of?
Bartosz Sypytkowski
@Horusiath
Christian Duhard
@cduhard
@Horusiath EventStore requires json if you want to use the built in projection framework
Bartosz Sypytkowski
@Horusiath
@cduhard you can always use custom json provider, the one akka uses is quite heavily oriented for akka-specific needs
Christian Duhard
@cduhard
it's a little late for that :)