These are chat archives for akkadotnet/akka.net

2nd
Aug 2016
William Austin
@wyldebill
Aug 02 2016 01:48
i want to use akka.net actors in a simple domain as such - you find interesting places and submit their lat/long to the system. the system catalogs it and makes it available for others to search/query. would each place be a separate actor?
Vagif Abilov
@object
Aug 02 2016 05:27
@wyldebill do these places need to perform actions by responding to messages? Do they have state? If so, they are good candidates for actors.
Erik Lagerholm
@stabface
Aug 02 2016 06:59
Does anyone have a code example of a decorator pattern implementation to use with Akka actors?
Marc Piechura
@marcpiechura
Aug 02 2016 07:56
@nanderto why haven't you forked the existing repository ? https://github.com/akkadotnet/Akka.Persistence.ServiceFabric
Noel
@nanderto
Aug 02 2016 08:19
@Silv3rcircl3 the implementation is different from the previous one at that location and when I asked on this gitter if there was interest in my alternative, @alexvaluyskiy suggested that I create a new repository for it under my account.
Daniel Söderberg
@raskolnikoov
Aug 02 2016 08:38
Hello! I would like some help with my akka cluster. I wont get it to work when I try to call an actor in the cluster. Dead letters all the time. Im swedish so If you want to help me in swedish you can do that.
Alex Valuyskiy
@alexvaluyskiy
Aug 02 2016 08:44
@nanderto why are you using Wire for serialization? Wire is designed for ... wire. For remoting and clustering. But not for persistent. You should choose the closest serializer to your storage. In many cases it is JSON. You also could use serializers like Protobuf in this cases. Maybe @rogeralsing is not agree with me
Noel
@nanderto
Aug 02 2016 08:55
@alexvaluyskiy I thought I would try it out, the standard Service Fabric way of serializing does not work at least, and it seemed like a good alternative for Akka, I am not sure I understand your objection, but I assumed that at some point it would be configurable, and users could choose there own.
Peter Bergman
@peter-bannerflow
Aug 02 2016 09:21
@raskolnikoov I'm swedish so you can PM me in swedish if u want to and I'll see if I can help
Arsene T. Gandote
@Tochemey
Aug 02 2016 09:32

Hello How long does it take ActorSystem to properly shutdown? because I got this in my log and I have not received any successful shutdown confirmation.

[DEBUG][16:08:02 09:15:45][ActorSystemImpl] System shutdown initiated

However I am running it inside Owin.

Arjen Smits
@Danthar
Aug 02 2016 09:32
@Tochemey normally its pretty quick, since there is no real way to block system shutdown.
It does need to spin down all your actors, so if you have alot, it might take abit longer, but even then it should be a few seconds at most
(and by alot i mean a few million :P)
Arsene T. Gandote
@Tochemey
Aug 02 2016 09:36
@Danthar Is there a proper way to implement the shutdown?
Arjen Smits
@Danthar
Aug 02 2016 09:40
there is not a one size fits all solution
it depends on what your actors are doing
normal shutdown is simply calling Terminate on the actor system and Wait() or await on WhenTerminated (or the terminate task itself)
but actor shutdown is asynchronous and non-deterministic
(granted it starts with the userguardians children, meaning, your actor)
So if you need to you could implement some kind of ordered termination
Arsene T. Gandote
@Tochemey
Aug 02 2016 09:44
ok
Arjen Smits
@Danthar
Aug 02 2016 09:45
what tend to do for non-trivial applications is:
  • Don't call Terminate on the ActorSystem directly, but let your actor call Context.Shutdown once all work has been done (if applicable)
  • Intercept application shutdown and send a message into your actor system to start shutting down, and send a response back when its ready to be terminated
Alex Valuyskiy
@alexvaluyskiy
Aug 02 2016 09:46
Just released an updated version of MongoDb plugin for Persistence
https://www.nuget.org/packages/Akka.Persistence.MongoDb/1.1.0.3-beta
Arjen Smits
@Danthar
Aug 02 2016 09:48
What the easiest way to handle this is, if work comes in from another actor system via remoting or clustering, use retry mechanisms for your work, so if you kill your actor system, even though any work will have been lost, it will simply be processed elsewhere (a different node) or presented again once you start up your actorsystem again.
Arsene T. Gandote
@Tochemey
Aug 02 2016 09:48
@Danthar Please can you provide some code snippets?
This message was deleted
Arsene T. Gandote
@Tochemey
Aug 02 2016 10:08
Hello can someone show me how to properly shutdown the actor system? I have stopped all the child actors created using the actors system. I want to know how to use WhenTerminated. Thank you
Marc Piechura
@marcpiechura
Aug 02 2016 10:17
@Tochemey what exactly do you want to do with WhenTerminated?
Arsene T. Gandote
@Tochemey
Aug 02 2016 10:19
I want to be able to display an termination logging info for instance.
Marc Piechura
@marcpiechura
Aug 02 2016 10:20
Then I would register a callback with RegisterOnTerminationwhere you write the log entry
that is automatically called once the system is terminated
Arsene T. Gandote
@Tochemey
Aug 02 2016 10:31

Hello How long does it take ActorSystem to properly shutdown? because I got this in my log and I have not received any successful shutdown confirmation.

[DEBUG][16:08:02 09:15:45][ActorSystemImpl] System shutdown initiated

However I am running it inside Owin.

@Silv3rcircl3 Please this what I am observing.
Arjen Smits
@Danthar
Aug 02 2016 11:03
@Tochemey So your calling ActorSystem.Terminate() and it never terminates ?
Arsene T. Gandote
@Tochemey
Aug 02 2016 11:25
@Danthar I have figured it out. I started a new thread that got executed before the ActorSystem.Terminate calling thread. Sorry for the false alert.
Vagif Abilov
@object
Aug 02 2016 12:03
A question about message serializability. Sure properly designed messages should be small and serializable, and for persistent and remote actors they must be serializable. But I have a scenario with a helper actor that just sends HTTP requests. It uses 3rd party library types to represent requests, and sometimes such request contains binary stream (for multipart forms). The stream processing doesn't happen until the actor starts generating the HTTP payload so it's just a unprocessed stream reference that is sent in a message to the HTTP request actor. I tested the implementation and it works fine. But since an instance of Stream type is obviously not meant to be used in actor messages, I wonder if this can lead to bad consequences even if in-proc scenario.
Arjen Smits
@Danthar
Aug 02 2016 13:23
@object if that message never leaves the local actorsystem, then its not a problem. There is nothing wrong with using non-serializable messages between a 'manager-actor' and its 'worker'. As long as you are aware of the drawbacks and limitations it imposes.
on a local actorsystem level. Akka could not care less. Its in the remoting, clustering and persistence scenario's that it becomes a problem
Vagif Abilov
@object
Aug 02 2016 13:25
Thanks @Danthar. I thought so too, and this is typical "worker" actor that never acts outside its manage scope.
to11mtm
@to11mtm
Aug 02 2016 13:27
Question about api deprecation.... Akka sez to use ReceiveAsync instead of Receive on ReceiveActor. Will receieveAsync still hold when processing a message from the mailbox? (i.e. if I send A,B to Actor1, Even if Message A takes a moment to process, it won't start processing Message B until A is done)
Arjen Smits
@Danthar
Aug 02 2016 13:39
@to11mtm the one message at a time guarentee still holds. Even though you are using ReceiveAsync with await
Boban
@bobanco
Aug 02 2016 15:15

Hi folks, am getting TargetInvocationException while startup, after upgrading my app to the latest akka version together with the latest one wire version. Could some1 help me
to figure out what is the issue? @rogeralsing

here is the stack trace.

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.MissingMethodException: Method not found: 'Void Wire.SerializerOptions..ctor(Boolean, System.Collections.Generic.IEnumerable`1<Wire.Surrogate>, Boolean, System.Collections.Generic.IEnumerable`1<Wire.Converters.ValueSerializerFactory>)'.
   at Akka.Serialization.WireSerializer..ctor(ExtendedActorSystem system)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at Akka.Serialization.Serialization..ctor(ExtendedActorSystem system)
   at Akka.Actor.Internal.ActorSystemImpl..ctor(String name, Config config)
   at Akka.Actor.ActorSystem.Create(String name, Config config)
   at ClusterSharding.App.Program.Main(String[] args) in D:\Projects\ClusterSharding.App\ClusterSharding.App\Program.cs:line 21
Press any key to continue . . .
William Austin
@wyldebill
Aug 02 2016 15:39
@object yes, each object has the location's lat/long, the name, and the number of times it's been 'found'. when it hits certain numbers of founds, it moves to a different state. what would i use to identify the actor? a string of the name of the location? or the lat/long as a string? or a guid? each actor has to have some type of identifier for it, but what do people use for this? because i don't want to search across all the actors to find the correct one, i need to have a unique identifier to get the actorref for it. am i thinking about this correctly?