These are chat archives for akkadotnet/akka.net

2nd
Nov 2015
MartinNiemandt
@MartinNiemandt
Nov 02 2015 07:17 UTC
Hi, is there a way to see all online actors in a system?
Roger Johansson
@rogeralsing
Nov 02 2015 07:33 UTC
@Horusiath that is a great idea, we could do that for serializers that are intended to be general for any object
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 08:18 UTC
@MartinNiemandt do you mean in scope of the single actor system or in the whole cluster?
@aph5nt sorry, I've missed where the sample code comes from ;)
MartinNiemandt
@MartinNiemandt
Nov 02 2015 08:20 UTC
@Horusiath just the local actor system that is running alongside my mvc application.
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 08:28 UTC

@MartinNiemandt prepare some actor, which will create ActorSelection for all of the actors and will receive ActorIdentity message from them:

Receive<ActorIdentity>(i => Console.WriteLine("Identity: " + i.Subject));
var selectAll = Context.ActorSelection("/**/*");
selectAll.Tell(new Identify(null));

this will display all of the actors on the console.

if you want to filter system actors and get only yours, use /user/**/* as selection path
MartinNiemandt
@MartinNiemandt
Nov 02 2015 08:31 UTC
@Horusiath Ok that seems easy enough, how wise would it be to use an actor as a broker between all client actors, that holds information for some actors?
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 08:32 UTC
in general, try to avoid that, this what supervision trees and parent-child relations are for, while event bus is for system-scoped events
Hussein Ait-Lahcen
@hussein-aitlahcen
Nov 02 2015 08:49 UTC
Hey
This message was deleted
physicsWorld.Ask<PhysicsWorld.BodyCreationResult>(new PhysicsWorld.CreateBody(entity))
.ContinueWith((task) => new GameObjectCreationResult(task.Result.Success))
.PipeTo(Sender);
This is the good way to give back a message to the sender ?
I mean what happend if someone call my actor while the PhysicsWorld is replying
Is the "Sender" variable immutable here ?
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 08:55 UTC
@hussein-aitlahcen in this case Sender will be pinned value to PipeTo but this is not good way to communicate between actors. Ask was designed to communicate from outside an actor system
Hussein Ait-Lahcen
@hussein-aitlahcen
Nov 02 2015 08:56 UTC
Ok so how should i do that, wrapping the sender into the CreateBody request ?
@Horusiath I can't use the Forward method now because later i will implement some stuff in the (task) => new GameOb.. lambda that have to be handled by the current actor
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 09:00 UTC
you can use tell, and then Receive<PhysicsWorld.BodyCreationResult> in the caller
Hussein Ait-Lahcen
@hussein-aitlahcen
Nov 02 2015 09:01 UTC
So i have to wrap the Sender into that message ? Because i have three actors here, the one that tell to create a game object, the second that store the game object and the third that create the physics body
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 09:02 UTC
you may want to read @rogeralsing post about design mindset in message-based world: http://blog.nethouse.se/2015/10/04/designing-reactive-actors-akka-net/
Hussein Ait-Lahcen
@hussein-aitlahcen
Nov 02 2015 09:02 UTC
@Horusiath I will do it now thanks
Hussein Ait-Lahcen
@hussein-aitlahcen
Nov 02 2015 09:07 UTC
Oh god im still stuck in a Request/Response mindset lol
Maybe you can tell me if i understood. I should create a new method that handle the BodyCreationResult (wrap the initial sender into it ?) and do my stuff in case of success then Tell the wrapped sender the result of the creation ?
Hussein Ait-Lahcen
@hussein-aitlahcen
Nov 02 2015 09:13 UTC
This message was deleted
Ending with somethin like
void IHandle(PhysicsWorld.BodyCreationResult msg)  
{
     if(msg.Success) {/* do my stuff */}
     msg.InitialSender.Tell(new GameObjectCreationResult(msg.Success); 
}
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 09:25 UTC
this is an option, but without a context it's hard to advise something specific ;)
Hussein Ait-Lahcen
@hussein-aitlahcen
Nov 02 2015 10:14 UTC
I have multiple MapInstance
MapInstance = actor
Each MapInstance have one PhysicsWorld actor (child)
When i want to add a GameObject to that map i tell a AddGameObject msg containing my gameobject
The map tell the PhysicsWorld to create a new phyical body, in case of success, it add the gameobject to the map and return the result
That said my MapInstance have only one PhysicsWorld so maybe i could double forward the message so that i dont have to wrapp the initial sender
in mapInstance : physicsWorld.Forward(new CreateBody...)
in physicsWorld : Parent.Forward(new BodyCreationResult...) (where Parent is obviously the MapInstance actor)
Then i will be able to do Sender.Tell in my mapinstance handler instead of msg.InitialSender.Tell ?
Hussein Ait-Lahcen
@hussein-aitlahcen
Nov 02 2015 10:22 UTC
actor A, actor B, actor C where C is a child of B
A tell B, B forward to C, C forward to parent, B tell the Sender (A)
This message was deleted
B is a sort of router
Zetanova
@Zetanova
Nov 02 2015 11:32 UTC
If there is a execution over ActorTaskScheduler.RunTask(), the next message will be processed after the execution finishes?
I am looking for a why to make a saga/process manager that can execute commands in sequenze but can except cancelation messages for them too.
Zetanova
@Zetanova
Nov 02 2015 11:47 UTC
Should i just create a tempActor for each execution?
Aaron Stannard
@Aaronontheweb
Nov 02 2015 16:34 UTC
C# 6 can compile down into .NET 4.5, right?
might upgrade the build agents this week to support it - I think I just have to update the versions of Mono and VS being used
Graeme Bradbury
@GraemeBradbury
Nov 02 2015 16:39 UTC
@Aaronontheweb Roslyn can build 4.5
Aaron Stannard
@Aaronontheweb
Nov 02 2015 16:39 UTC
@GraemeBradbury cool! I thought so
that answers my question then - I'd love to use the C# syntax features
in 6
I just didn't want to have to bump the runtime version of Akka.NET
wasn't willing to make that tradeoff
but if we can have our cake and eat it too, why not
I'm going to take a look at using some configuration management tools for our build agents and recreate them that way
my VM-image approach accumulates technical debt at an alarmingly fast rate due to how often I have to upgrade the .NET runtime as of late
so wish we had Docker for Windows already
but in lieu of that, might try some Hashicorp stuff
(if it works with Windows)
Kamil Wojciechowski
@aph5nt
Nov 02 2015 16:42 UTC
how to PreStart with F# api ?
Zetanova
@Zetanova
Nov 02 2015 16:45 UTC
yes Docker will be good
Roger Johansson
@rogeralsing
Nov 02 2015 17:37 UTC
I did an Akka.NET presentation for MS today, nice to see that even their architects are interested
Graeme Bradbury
@GraemeBradbury
Nov 02 2015 17:38 UTC
@rogeralsing :+1:
Roger Johansson
@rogeralsing
Nov 02 2015 17:39 UTC
btw. regarding C#6 features, that means we need vs.net 2015 to code, right? as the tooling still needs to understand the new features (?)
even if we compile for 4.5
Zetanova
@Zetanova
Nov 02 2015 17:46 UTC
they changed in the IDE and compiler a lot. Basicly the new features are "extensions" that somebody can now create by himself.
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 18:03 UTC
@aph5nt
let a = 
    spawn system "act"
    <| fun mailbox ->
        // this part works like pre-start
        let rec loop () = actor {
          // receive logic
        }
        loop ()
@Zetanova sagas/process managers are basically actors, and cancellations are messages
Aaron Stannard
@Aaronontheweb
Nov 02 2015 18:10 UTC
@annymsMthd dude, that is awesome!
@Horusiath lol sunbathing in the UK
I'll take a look at the PR today - nice work man
Kamil Wojciechowski
@aph5nt
Nov 02 2015 18:17 UTC
@Horusiath thx
Diego Frata
@diegofrata
Nov 02 2015 18:18 UTC
I'm using a ReceivePersistentActor, but there is no method like Become(Action configure). How am I supposed to manage switchable behavior?
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 18:28 UTC
@diegofrata Become is method of Context not actor itself.
Diego Frata
@diegofrata
Nov 02 2015 18:55 UTC
@Horusiath Still it doesn't have a signature that resembles the ReceiveActor. Which means I can't use the methods Command and Recover, right? Am I missing something?
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 18:58 UTC
behavior changes applies only to command receivers, never to recover
recovery method is applied only once actor is recovering after being recreated. It only purpose is to restore state from events and snapshots. No application logic should ever reside there, so becoming and state machines has no use in this case
Diego Frata
@diegofrata
Nov 02 2015 19:01 UTC
@Horusiath but how do I reconfigure my command receivers? That's what I'm not getting.
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 19:03 UTC
ehh, I see. I haven't used ReceivePersistentActor, always untyped or raw version
this is missing part in the API. I'll set an issue for this one. @diegofrata thanks for pointing that out :)
Diego Frata
@diegofrata
Nov 02 2015 19:06 UTC
Ah! That's fine. I'll use the untyped one for now.
Thanks for helping out!
Aaron Stannard
@Aaronontheweb
Nov 02 2015 19:45 UTC
anyone else having an issue since the Paket release where ./build.cmd all fails locally?
issue with FAKE?
Running build failed.
Error:
System.Exception: Start of process  failed. Cannot start process because a file name has not been provided.
   at Fake.ProcessHelper.ExecProcessWithLambdas@76-16.Invoke(String message) in C:\code\fake\src\app\FakeLib\ProcessHelp
er.fs:line 76
   at Fake.ProcessHelper.ExecProcessWithLambdas(FSharpFunc`2 configProcessStartInfoF, TimeSpan timeOut, Boolean silent,
FSharpFunc`2 errorF, FSharpFunc`2 messageF) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 76
   at Fake.MSTest.MSTest(FSharpFunc`2 setParams, IEnumerable`1 assemblies) in C:\code\fake\src\app\FakeLib\UnitTest\MSTe
st.fs:line 100
   at FSI_0001.Build.clo@209-14.Invoke(Unit _arg9) in D:\Repositories\olympus\akka.net\build.fsx:line 218
   at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 48
3
Aaron Stannard
@Aaronontheweb
Nov 02 2015 19:53 UTC
FAKE seems to break all the time
Aaron Stannard
@Aaronontheweb
Nov 02 2015 20:00 UTC
might be a local issue this time since I uninstalled 3 older versions of VS over the weekend
Aaron Stannard
@Aaronontheweb
Nov 02 2015 20:06 UTC
yeah, that was the issue
symbolic link FTW
Zetanova
@Zetanova
Nov 02 2015 21:26 UTC
@Horusiath If the process-actor is Telling multiple AR an update-command the process-actor should wait on the answer of the AR's before it send the completed message to the caller. Should i just implement it with a counter ina child-actor to receive the answer of the AR's?
And the next one: If the process-actor is with a router (smallest inbox) it would need to host the real process-actor as a child, so that the process-actor can hold new commands from the router back until the child terminates. looks very complicated ... schould it be? The hole router would be then pointless. Until the process-actor would lock itself over the time of the processing and communication to the AR's and Caller (Cancel) over a child actor.
Bartosz Sypytkowski
@Horusiath
Nov 02 2015 21:44 UTC
@Zetanova
  1. You could just store actors, which you'll send update message to, in separate struct like Set. Then wait for them to respond, and take of all responders from the set. Once set is empty or timeout will occur (using SetReceiveTimeout) you could send completion/failure message.
  2. Probably router is not a good choice in this scenario.
Zetanova
@Zetanova
Nov 02 2015 22:13 UTC
thx, with the set it will be possible to distinguished between the caller of the process (cancel) and the response from the AR's. i will host the processes over the ActorCordinator.
Zetanova
@Zetanova
Nov 02 2015 23:02 UTC
@Horusiath The problem/question with the long running process is not solved. If i am hosting it over ActorTaskScheduler.RunTask() no new messages will be porcessed (answers and cancel)
cyril andreichuk
@andreichuk
Nov 02 2015 23:06 UTC

hi. i have the next section in my HOCON config:

dedicated-dispatcher {
                        type = PinnedDispatcher
                        throughput = 100
                    }

this line

var userApp = _actorSystem.ActorOf(Props.Create<UserAppActor>().WithDispatcher("dedicated-dispatcher"), "user-app");

throws an exception "Akka.Configuration.ConfigurationException: Dispatcher [dedicated-dispatcher] not configured for path ..." though the documentation says that a dispatcher can be set using code here http://getakka.net/docs/working-with-actors/Dispatchers#configuring-dispatchers
so such a behavior is a bug?

Zetanova
@Zetanova
Nov 02 2015 23:07 UTC
@Horusiath i am basicly getting data from a external service and looking it up on the read-model. If found i send to the AR an updateCommand, if not i send to the AR an addCommand. The AR's on UpdateEvent would Tell the State back. this State i need to send back to the caller of the process. This task can run over 30min
Zetanova
@Zetanova
Nov 02 2015 23:12 UTC
Where/how to host this thread/process? Should i create for every entity of the feed (external service) a subCommand on a background thread?
its getting somehow complicated :(