Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 11:24
    Kenji-Tanaka commented #3887
  • 10:45
    nagytech edited #4086
  • 10:45
    nagytech synchronize #4086
  • 10:43
    nagytech opened #4086
  • 09:00
    Horusiath commented #4077
  • 06:31
    Aaronontheweb commented #4085
  • 06:28
    Aaronontheweb commented #4085
  • 06:24
    Aaronontheweb commented #4085
  • Dec 07 11:49
    IgorFedchenko commented #4085
  • Dec 07 10:31
    IgorFedchenko commented #4085
  • Dec 07 08:36
    IgorFedchenko commented #4085
  • Dec 06 20:57
    IgorFedchenko commented #4085
  • Dec 06 20:32
    IgorFedchenko commented #4085
  • Dec 06 20:01
    IgorFedchenko commented #4085
  • Dec 06 19:55
    IgorFedchenko commented #4085
  • Dec 06 16:22
    Aaronontheweb labeled #3997
  • Dec 06 16:22
    Aaronontheweb closed #3997
  • Dec 06 16:20
    IgorFedchenko commented #3997
  • Dec 06 16:08
    IgorFedchenko commented #4085
  • Dec 06 15:50
    Aaronontheweb assigned #4085
Aaron Stannard
@Aaronontheweb
we support async / await inside Akka.NET actors now
didn't at the time
I would still use PipeTo, personally
qwoz
@qwoz
Yeah, though the drawbacks of blocking the actor are still there, correct?
Aaron Stannard
@Aaronontheweb
correct
they are
await has a cost associated with it
to11mtm
@to11mtm
@Horusiath I have some great ideas for eventsourcing examples but you'd be doing my work lol.
Arsene
@Tochemey
@qwoz I am just asking best practices. So far I have been using await inside my Receive. I just want to know whether it is recommended.
Aaron Stannard
@Aaronontheweb
I don't recommend it
wdspider
@wdspider
does the sharding stuff support multiple sets of actors? i.e. Actor A for Node Role A and Actor B for Node Role B ?
Aaron Stannard
@Aaronontheweb
avoid it if possible and use PipeTo instead
PipeTo doesn't block the actor
so you can kick off an asynchronous task and pipe it back to the actor as a message later
the actor can keep doing other things while that task is running
the only case where I think using await makes a lot of sense inside an actor is if you have complex error handling routines
where you might be doing multiple chained async operations
and have to handle exceptions for each
Arsene
@Tochemey
ok
Aaron Stannard
@Aaronontheweb
that's easier to express with await
doing that with ContinueWith and PipeTo can be cumbersome
if your error handling is pretty simple
i.e. pass / fail error handling
then you're better off with a continuation and pipe to
Arsene
@Tochemey
@Aaronontheweb So if I am using a third party lib that offers async methods and sync method I should rather use the sync method. Am I right?
Aaron Stannard
@Aaronontheweb
no
use the async method
just don't await it
pipe the results to yourself instead
Arsene
@Tochemey
Ok
I got it
explains that in more detail
although my comments about await in that blog post are outdated
as I mentioned earlier
qwoz
@qwoz
It'd be really nice if the ContinueWith/PipeTo had a bit more syntactic sugar around it... it's a bit cumbersome to take the result and, if the next thing depends on state from the current message, having to wrap the state in order to be able to process it for the next thing.
I'm not sure if that's feasible or even possible
Aaron Stannard
@Aaronontheweb
you basically have to close over the bits of state you need
qwoz
@qwoz
Yeah... it just seems like there must be a better way. For example, if you want to lookup who owns an object, then do something if that owner has IsAdmin = true setting. Currently you might lookup by ID to fetch the user record and, based on that, find the pref, then perform the original action. This might vary depending on if you're looking up the owner vs. the creator, for instance. So there's a bunch of what feels like unnecessary keyboard mashing in order to pass along enough information to be able to process the result based on the state of the original request.
Arsene
@Tochemey
@Aaronontheweb How do we then use the ReceiveAsync seeing that Receive will be obsolete in the near versions?
qwoz
@qwoz
Receive<Foo>(async foo => ... is obsolete; you need to use ReceiveAsync<Foo>(async foo => ... instead. As far as I know, Receive<Foo>(foo => ... isn't going away.
Arsene
@Tochemey
I ask that question because of ContinueWith and PipeTo
Corneliu
@corneliutusnea
Is there a way to broadcast a message to all actors part of a SmallestMailboxPool? It's an init message that I want to reach all children
If not, what is the right way to do it? Make the children ask the parent for the init info?
Bartosz Sypytkowski
@Horusiath
@corneliutusnea have you tried to send routerRef.Tell(new Broadcast(initMessage))?
hisabir
@hisabir
Hi, When to expect Akka.Net 1.5 release?
Corneliu
@corneliutusnea
@hisabir no, I haven't tried that but that's looks like a good way to do it. For now I did it as a PreStart Context.Parent.Tell(new PleaseInitMe()) kind of message that the parent replies with the correct init
hisabir
@hisabir
release 1.5...
Bartosz Sypytkowski
@Horusiath
@hisabir the exact date is not yet known
most of the changes, it introduces, are available right now in form of optional settings or plugins