These are chat archives for akkadotnet/akka.net

16th
Nov 2015
Alexander Pantyukhin
@alexpantyukhin
Nov 16 2015 05:51
Hi all! I'm working with the integrating Akka.Hocon into the Akka.net repository (akkadotnet/akka.net#1419). The point which is not clear how to do is provide backwards compatible as the config section points back. Does someone can advise how to implement it?
The problem that we already have AkkaConfigurationSection in the Akka.Hocon repository with the same namespace. And I can't just leave only AkkaConfigurationSection in the Akka.net repository.
Thomas Tomanek
@thomastomanek
Nov 16 2015 11:34
yo yo. So if WithSupervisorStrategy configures the strategy for the actor being created, how do I go about setting the strategy for the ActorSystem?
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 11:43
@sadprofessor you don't. This is what supervision hierarchies are for. In most cases your top-level actors should work as coordinators, while actual work is usually done by their children
Thomas Tomanek
@thomastomanek
Nov 16 2015 11:58
@Horusiath ok fair enough that sounds reasonable. So the user guardian makes no attempt to restart top level actors?
Arjen Smits
@Danthar
Nov 16 2015 12:30
@sadprofessor the default supervisionstrategy restarts your actor on failure. Afaik GuardianActors (users/system etc) uses this default
Thomas Tomanek
@thomastomanek
Nov 16 2015 12:44
@Danthar ah lovely thanks
John Nicholas
@MrTortoise
Nov 16 2015 13:56
@Aaronontheweb wea re actually considering using the exact tool @rogeralsing linked to. Strong naming would be helpful for us.
and i just realised this gitter window was 3 days out of date ...
Weston
@ronnyek
Nov 16 2015 15:19
So I went through the boot camp and have questions about the scheduling etc
Eg are schedules for the send repeatedly persisted... Or just per session of actor system
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 15:26
@ronnyek they are not persisted. This can be done using 3rd party libs like Quartz.NET
Weston
@ronnyek
Nov 16 2015 15:27
OK yeah I just didn't know if that sort of thing was advisable.... I've got a system I want to build that would go out and talk to web services po n regular scheduled intervals
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 15:36
akka scheduler is designed to frequent small intervals, but if you need something more specialized, quartz will be good (there is actually akka-quartz-scheduler extension on JVM side AFAIK)
Kevin McFarlane
@kevinmcfarlane
Nov 16 2015 16:02
Guys, why am I getting a timeout failure with this NUnit test?
var actor = Sys.ActorOf(Props.Create(() => new ZipActor()));
string path = "some path";

actor.Tell(new ZipMessage(path));

var message = ExpectMsg<ZipMessage>();
chillitom
@chillitom
Nov 16 2015 16:04
..
mph911
@mph911
Nov 16 2015 16:09
@skotzko :clap: for the TestKit Stuff
John Nicholas
@MrTortoise
Nov 16 2015 16:40
@kevinmcfarlane ask on stack overflow. You would need to post the code of zip actor also (or face the wrath of vote downs) ... The only answer anyone here can give from what you have posted is ... because your expect fails.
chillitom
@chillitom
Nov 16 2015 16:47
with PersistentViews is there any progress on the "reactive streams" front? Be great to have event triggered views.
Weston
@ronnyek
Nov 16 2015 17:04
so schedulers are somewhat pluggable? Eg, I could write an equivalent akkaquartsscheduler for the .net side?
Aaron Stannard
@Aaronontheweb
Nov 16 2015 17:59
@Horusiath happy birthday buddy
Aaron Stannard
@Aaronontheweb
Nov 16 2015 18:04
and thanks for the PR -taking a look at it
I'll do a test publish on my local machine with our MyGet credentials and see if it aligns with what we currently do
Aaron Stannard
@Aaronontheweb
Nov 16 2015 18:38
@ronnyek yep, they're pluggable - the Akka.TestKit stuff we published last Friday shows an example of how to swap out a scheduler
however, it should be noted that schedulers are intended to be temporal and local in Akka.NET
it's meant for regularly recurring short jobs
not for long-running, durable jobs
i.e. the weekly ETL
the Akka.NET scheduler is meant for "send a copy of this message once every 100ms"
https://petabridge.com/blog/akka-testkit-introduction/ - scroll to the very bottom for an example
"How do I test scheduled messages?"
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 18:59
@kevinmcfarlane if I'm right you're trying to check if ZipMessage has reached ZipActor, right?
If so, you need to know, that this is not what ExpectMsg is made for. What it's made for is testing if messages reach mailbox of the TestActor, not your custom actors
@chillitom we need reactive streams first ;)
Kevin McFarlane
@kevinmcfarlane
Nov 16 2015 19:20
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 19:33
@kevinmcfarlane just like I said, you didn't quite understood what ExpectMsg is made for
don't test if message has reached an actor - if you do, you actually test the framework, not your code ;)
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 19:39
instead test behavior of actor itself - activate it's behavior trough message and assert side effects or messages, it generated in return. This is what ExpectMsg was made for
Amon-Ra Mackie
@nevaenuf
Nov 16 2015 20:43
Got a question concerning supervisor strategies. Does anyone know how to get access to the message that causes a failure without creating a wrapper exception and trapping the message?
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 20:48
@nevaenuf you probably can't unless you pack it inside message itself. Parent actor doesn't need to be aware of every message coming to it's children. What do you need it for?
Amon-Ra Mackie
@nevaenuf
Nov 16 2015 20:54
@Horusiath the message contains information that I use for logging when a child actor fails. Also, the child actor represents a unit of work that I need to report on to give the user an opportunity to restart if they so desire. I could trap the exception, tell to sender, and throw as well, but didn't know if that's the best strategy.
Aaron Stannard
@Aaronontheweb
Nov 16 2015 20:58
@nevaenuf hmm... you could design a custom SupervisionStrategy that reads state from the exception object, and you could include the message that triggered the exception as part of that state
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 20:58
In general supervision strategies are used solely to tell child, what to do.
You can log error on actor level itself. When it comes to restarts, you can order actor to send back some dedicated failure message in PreRestart or PostStop method.
Amon-Ra Mackie
@nevaenuf
Nov 16 2015 21:00
@Horusiath, that seems to conflict with the advice @Aaronontheweb just gave. Should we not be logging or performing
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 21:00
i.e. PreRestart has access to both exception and message
Amon-Ra Mackie
@nevaenuf
Nov 16 2015 21:00
@Horusiath , rat's i just hit enter instead...
Cool. That's what I wanted to know. So if I wanted to stop the child, I should send a poison pill to the child in the PreRestart after logging the exception?
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 21:02
I shared my opinion ;) usually there is more than one way to solve the problem, and it's up to you to figure out what is working
Amon-Ra Mackie
@nevaenuf
Nov 16 2015 21:03
Yeah, I'm new to this system, so I'm trying to go for best practices. But I appreciate the help!
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 21:03
PreRestart is called when child will be restarted, but not stopped.
Amon-Ra Mackie
@nevaenuf
Nov 16 2015 21:24
@Horusiath @Aaronontheweb Thanks guys. I'm going with the simple approach and packing the message inside an exception. Seems the easiest way and more importantly, the most expected way to use the framework for a bunch of newbies.
Darren Ford
@4deeptech
Nov 16 2015 22:06
@trbngr I'm interested in your ARM templates for the EventStore cluster. Do you have those out somewhere?
Bartosz Sypytkowski
@Horusiath
Nov 16 2015 22:09
I feel, that I need to show off my new version of API for Akkling (my fork of Akka F# API, that adds new style and compile type checking for messages passed through actor refs) - examples are here and they look pretty sweet. I'm esspecially proud of totally new API for persistence.
Weston
@ronnyek
Nov 16 2015 22:41
I feel like f# could have been better with a better syntax