Re: [akka-user] Sending a message from an Akka actor at Fixed interval

2014-04-09 Thread Konrad Malawski
Hello Soumya, You can use the scheduler the same way you’re already doing it from within an Actor too. // inside an Actor (Subscribe Actor) context.system.scheduler.schedule(30.seconds, 30.seconds) { // your publishing here } I hope this helps, happy hakking! -- Cheers, Konrad Malawski blog.p

Re: [akka-user] Re: Work distribution in cluster using routers

2014-04-09 Thread Martynas Mickevičius
So I forked your example project and added routee number tracking between nodes. You can find it here: https://github.com/2m/scratch-akka-cluster-singleton/tree/distributed When you start the first seed node with the *sbt "run-main sample.cluster.simple.SimpleClusterApp 2551"* you will notice s

[akka-user] Re: InvalidActorNameException when recreating actor with context.watch

2014-04-09 Thread Iain Hull
I have been looking into this in more detail and wonder if this could be an Akka bug. The docs say: http://doc.akka.io/docs/akka/snapshot/java/untyped-actors.html Since stopping an actor is asynchronous, you cannot immediately reuse the > name of the child you just stopped; this will result in

Re: [akka-user] multiple agents for maintaining mutable state between requests

2014-04-09 Thread Martynas Mickevičius
This could work, but you would have to make sure that all the actors which share that agent are running on the same node. Did you consider using solution from yesterdays discussion to cancel messages using PriorityMailbox for this s

Re: [akka-user] Sending a message from an Akka actor at Fixed interval

2014-04-09 Thread Patrik Nordwall
On Wed, Apr 9, 2014 at 10:14 AM, Konrad Malawski < konrad.malaw...@project13.pl> wrote: > Hello Soumya, > You can use the scheduler the same way you're already doing it from within > an Actor too. > Inside an actor you should always schedule a message to self instead of running a block of code. Th

Re: [akka-user] multiple agents for maintaining mutable state between requests

2014-04-09 Thread Meena Venkat
Hi Martynas Thank you very much for a prompt reply. As far as Agent question is concerned - YES - for now the application is running on a single node - so I think it should be ok. But thanks for pointing that out as i don't think I saw that note in the documentation. So what is alternative if th

[akka-user] Can one actor exists in two paths at once?

2014-04-09 Thread Chanan Braunstein
My use case: I have an Actor per websocket called a User. I have groups of user that need to be notified together. A group is called a Channel. My current implementation is a Channel contains a hashmap of the user id and the ActorRef to notify. My concern about this is that it won't work (with

Re: [akka-user] multiple agents for maintaining mutable state between requests

2014-04-09 Thread √iktor Ҡlang
Don't use a while loop, send continuation messages. :) On Apr 9, 2014 12:32 PM, "Meena Venkat" wrote: > Hi Martynas > > Thank you very much for a prompt reply. > As far as Agent question is concerned - YES - for now the application is > running on a single node - so I think it should be ok. But t

Re: [akka-user] Re: Work distribution in cluster using routers

2014-04-09 Thread Jem
Your example worked just fine. I foolishly logged the result of the work as it arrived back at the controller and inferred incorrectly that where the log message appeared is where the work occurred. A simple and obvious-in-hindsight error. Thanks for your time! On 9 April 2014 19:08, Martynas Mi

Re: [akka-user] multiple agents for maintaining mutable state between requests

2014-04-09 Thread MV
Thanks Martynas :-) But what is a continuation message? Can I get an example or sample pseudocode for my while loop pseudocode? Assuming that RequestProcessor -> Sends RequestInfo_1 to -> DataBaseWorker (this uses the while loop) Some time later: RequestProcessor ->Sends Cancel_RequestInfo_1 ->

Re: [akka-user] multiple agents for maintaining mutable state between requests

2014-04-09 Thread √iktor Ҡlang
def receive = { case Next => doWork() self ! Next } On Wed, Apr 9, 2014 at 2:36 PM, MV wrote: > Thanks Martynas :-) But what is a continuation message? > Can I get an example or sample pseudocode for my while loop pseudocode? > > Assuming that RequestProcessor -> Sends RequestInfo_1 t

[akka-user] Akka 2.3.2 Released

2014-04-09 Thread Patrik Nordwall
*Dear hAkkers,* We--the Akka committers--are pleased to be able to announce the availability of Akka 2.3.2. This is the second maintenance release of the 2.3 branch. It contains fixes for several issues. This release is backwards binary compatible with version 2.3.0 and 2.3.1 which means that the

Re: [akka-user] Re: Work distribution in cluster using routers

2014-04-09 Thread Martynas Mickevičius
Great! Glad it cleared things up! On Wed, Apr 9, 2014 at 3:06 PM, Jem wrote: > Your example worked just fine. I foolishly logged the result of the work > as it arrived back at the controller and inferred incorrectly that where > the log message appeared is where the work occurred. A simple and

Re: [akka-user] Can one actor exists in two paths at once?

2014-04-09 Thread Heiko Seeberger
No, an actor has exactly one unique actor path. I'm not sure whether I fully understand, but maybe a channel could be an actor which allows other actors (users) to register as listeners? Heiko On Wed, Apr 9, 2014 at 12:24 PM, Chanan Braunstein < chanan.braunst...@pearson.com> wrote: > My use c

[akka-user] Re: [akka-dev] Akka 2.3.2 Released

2014-04-09 Thread Heiko Seeberger
Thanks for this release! Heiko On Wed, Apr 9, 2014 at 2:16 PM, Patrik Nordwall wrote: > *Dear hAkkers,* > > We—the Akka committers—are pleased to be able to announce the availability > of Akka 2.3.2. This is the second maintenance release of the 2.3 branch. It > contains fixes for several issue

[akka-user] Re: InvalidActorNameException when recreating actor with context.watch

2014-04-09 Thread Martynas Mickevičius
Hi Iain, I think the problem could be in your code here: deathReporter ! DeathReportActor.Watch(fated, self, Create(value)) context.system.stop(fated) Here I can see a race condition. In some cases *fated* actor can be stopped before *Watch* message in handled. So *DeathReportActor* never g

[akka-user] Re: File I/O design

2014-04-09 Thread Martynas Mickevičius
Hi Christopher, Since you do not keep any state in your actors and you are not running them on different nodes, actors may not be the best plan here. You could just run your file copying code on multiple futures. I also found quite an old discussion regarding akka and file operations here

Re: [akka-user] Re: How to configure mailbox for routees under BalancingPool in akka 2.3.x?

2014-04-09 Thread Dmitry Schitinin
Hi Björn, Thanks for answering! Yes, I have suggestion for a solution. It's described here https://www.assembla.com/spaces/akka/tickets/3964#/activity/ticket: OK, I'm going to create pull request in the near future. Thanks! Regards, Dmitry среда, 2 апреля 2014 г., 19:13:58 UTC+4 пользователь

[akka-user] scala.collection.immutable.Seq

2014-04-09 Thread Alias
Hi, my question is: how can I set scala.collection.immutable.Seq seedNodes =??? Thank you so much, Best Regards -- >> Read the docs: http://akka.io/docs/ >> Check the FAQ: >> http://doc.akka.io/docs/akka/current/additional/faq.html >> Search t

Re: [akka-user] scala.collection.immutable.Seq

2014-04-09 Thread √iktor Ҡlang
scala.collection.immutable.Seq seedNodes = Nil On Wed, Apr 9, 2014 at 4:42 PM, Alias wrote: > Hi, > > my question is: how can I set scala.collection.immutable.Seq > seedNodes =??? > > Thank you so much, > > Best Regards > > -- > >> Read the docs: http://akka.io/docs/ > >> Check

Re: [akka-user] scala.collection.immutable.Seq

2014-04-09 Thread √iktor Ҡlang
But I guess that isn't really a helpful answer. Waht do you want this immutable Sequence of seedNodes to do? On Wed, Apr 9, 2014 at 4:45 PM, √iktor Ҡlang wrote: > scala.collection.immutable.Seq seedNodes = Nil > > > On Wed, Apr 9, 2014 at 4:42 PM, Alias wrote: > >> Hi, >> >> my question is: h

Re: [akka-user] scala.collection.immutable.Seq

2014-04-09 Thread Heiko Seeberger
scala.collection.immutable.Seq seedNodes = throw new Error("an implementation is missing") ;-) Heiko On Wed, Apr 9, 2014 at 3:42 PM, Alias wrote: > Hi, > > my question is: how can I set scala.collection.immutable.Seq > seedNodes =??? > > Thank you so much, > > Best Regards > > -- > >>

[akka-user] Re: Propagation of error messages for Tcp Connect

2014-04-09 Thread Martynas Mickevičius
Hi Andrew, you can see detailed reason by turning on DEBUG log messages. Here is the code that handles outgoing TCP connections: https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/io/TcpOutgoingConnection.scala#L45 -- Martynas Mickevičius Typesafe

Re: [akka-user] Re: Propagation of error messages for Tcp Connect

2014-04-09 Thread Martynas Mickevičius
Yea, sorry. I did not see that you have already dug the source code. On Wed, Apr 9, 2014 at 5:54 PM, Martynas Mickevičius < martynas.mickevic...@typesafe.com> wrote: > Hi Andrew, > > you can see detailed reason by turning on DEBUG log messages. > > Here is the code that handles outgoing TCP conn

Re: [akka-user] Re: Propagation of error messages for Tcp Connect

2014-04-09 Thread Andrew Charles
Yeah actually if the debug could be turned to ERROR or even WARNING I could live with that. Of course, other users of this might consider that annoying given they might not care about seeing that in their logs. Perhaps this new reactive thing the akka team is working on makes all of this obsol

Re: [akka-user] scala.collection.immutable.Seq

2014-04-09 Thread Patrik Nordwall
I think you are looking for akka.japi.Util.immutableSeq, which will construct a scala.collection.immutable.Seq from a java.lang.Iterable or array. /Patrik On Wed, Apr 9, 2014 at 4:46 PM, √iktor Ҡlang wrote: > But I guess that isn't really a helpful answer. > > Waht do you want this immutable Se

Re: [akka-user] scala.collection.immutable.Seq

2014-04-09 Thread √iktor Ҡlang
Right, good suggestion Patrik! On Wed, Apr 9, 2014 at 5:13 PM, Patrik Nordwall wrote: > I think you are looking for akka.japi.Util.immutableSeq, which will > construct a scala.collection.immutable.Seq from a java.lang.Iterable or > array. > /Patrik > > > On Wed, Apr 9, 2014 at 4:46 PM, √iktor Ҡl

Re: [akka-user] multiple agents for maintaining mutable state between requests

2014-04-09 Thread MV
Thanks a lot Martynas. That worked very well actually. I did not even need to do the Agent thing or the Priority Mail box solution. Thanks a lot and hope I am not going to bug you too soon :-) Meena On Wednesday, April 9, 2014 9:01:21 AM UTC-4, √ wrote: > > def receive = { > case Next => >

Re: [akka-user] Can one actor exists in two paths at once?

2014-04-09 Thread Chanan Braunstein
Hi Heiko, Right, it would be, and that is the way I have it now, I don't think I should maintain that last myself (maybe I am wrong). So my first attempt to remove that list from my actor was with the EventBus but that is limited to one JVM. So my questions are: 1. Should I just stop worryin

[akka-user] Re: InvalidActorNameException when recreating actor with context.watch

2014-04-09 Thread Iain Hull
Hi Martynas, Thank you for you fix. This does indeed fix my case and I am very happy change me code accordingly. However can you expand on the semantics of watch? Is it only safe to call watch from the same actor that calls stop? Or is it only safe to recreate a dead actor if the watch was

Re: [akka-user] multiple agents for maintaining mutable state between requests

2014-04-09 Thread √iktor Ҡlang
You replied to my email but addressed Martynas, which solution worked for you? Cheers, V On Apr 9, 2014 6:56 PM, "MV" wrote: > Thanks a lot Martynas. That worked very well actually. I did not even need > to do the Agent thing or the Priority Mail box solution. > > Thanks a lot and hope I am not

Re: [akka-user] Can one actor exists in two paths at once?

2014-04-09 Thread √iktor Ҡlang
Hi Chanan, How about measuring such a scenario? Cheers, V On Apr 9, 2014 9:11 PM, "Chanan Braunstein" wrote: > Hi Heiko, > > Right, it would be, and that is the way I have it now, I don't think I > should maintain that last myself (maybe I am wrong). So my first attempt to > remove that list fr

Re: [akka-user] Re: InvalidActorNameException when recreating actor with context.watch

2014-04-09 Thread √iktor Ҡlang
This sounds like a bug to me, but I'll leave it to the Akka team to weigh in on :-) On Apr 9, 2014 9:11 PM, "Iain Hull" wrote: > Hi Martynas, > > Thank you for you fix. This does indeed fix my case and I am very happy > change me code accordingly. > > However can you expand on the semantics of w

Re: [akka-user] Can one actor exists in two paths at once?

2014-04-09 Thread Chanan Braunstein
Hi Viktor, I am guessing you mean measuring my current way - i.e. keeping a hashmap of the users inside the ChannelActor. That's fine, it sounds like that is way to go, I am just trying to validate the correct way, if it makes sense to everyone, I will keep going and stress test. If someone has

Re: [akka-user] Can one actor exists in two paths at once?

2014-04-09 Thread √iktor Ҡlang
The golden rule of optimization is: measure. measure. measure. :) On Wed, Apr 9, 2014 at 9:23 PM, Chanan Braunstein < chanan.braunst...@pearson.com> wrote: > Hi Viktor, > > I am guessing you mean measuring my current way - i.e. keeping a hashmap > of the users inside the ChannelActor. That's fin

[akka-user] Strange timeout exception during cluster start

2014-04-09 Thread nitesh . neema
Hello, I have few clusters running happily with the same code. We are trying to deploy a new cluster with same code. But, keeps getting following exception. The big difference is we have compute coming from openstack based internal cloud. Any hints on how to figure out what is going on will be

Re: [akka-user] Strange timeout exception during cluster start

2014-04-09 Thread √iktor Ҡlang
Hi Nitesh, it means that the Listen operation times out (10 seconds default), you can try to increase that timeout and see if it helps, but I have never seen that happen before so if I were you I'd go over the removing configuration both for Akka and for the machine. On Wed, Apr 9, 2014 at 11:12

Re: [akka-user] Strange timeout exception during cluster start

2014-04-09 Thread nitesh . neema
Hello, Changed the configuration of startup-timeout = 60 s. Still getting the same issue. The strange thing is the same code is deployed on three separate clusters and works fine. 22:38:57.853 [BotCloud-akka.actor.default-dispatcher-4] INFO Remoting - Starting remoting Exception in thread "ma

Re: [akka-user] Can one actor exists in two paths at once?

2014-04-09 Thread Heiko Seeberger
Hard to answer without data from perf measurement. On the other hand I don't think that the EventBus, the implementation of which happens to be actor based, would handle millions of subscribers more effectively that a "normal" actor. Heiko On Wed, Apr 9, 2014 at 7:11 PM, Chanan Braunstein < cha

Re: [akka-user] Strange timeout exception during cluster start

2014-04-09 Thread √iktor Ҡlang
Have you tried to bind to the same interface port from another program on the same machine? I think you need to make sure it is an Akka problem rather than a machine problem before we can even start debugging it from an Akka perspective. On Thu, Apr 10, 2014 at 12:45 AM, wrote: > Hello, > > Cha

[akka-user] Cluster healing question

2014-04-09 Thread Alex Cruise
Hey folks, This might be covered by the docs, but *shrug* :) Let's say I have a cluster that suffers from a network connectivity issue between the left and right hemispheres, persisting long enough that both sides believe the other side is down. When the connectivity issue is resolved, presumabl

Re: [akka-user] Cluster healing question

2014-04-09 Thread √iktor Ҡlang
On Thu, Apr 10, 2014 at 1:32 AM, Alex Cruise wrote: > Hey folks, > > This might be covered by the docs, but *shrug* :) > > Let's say I have a cluster that suffers from a network connectivity issue > between the left and right hemispheres, persisting long enough that both > sides believe the other

Re: [akka-user] Cluster healing question

2014-04-09 Thread Alex Cruise
On Wed, Apr 9, 2014 at 4:42 PM, √iktor Ҡlang wrote: > 1) Can one hemisphere be allowed to live, and the other be required to >> reboot in order to rejoin? If so, who decides which one, and how? e.g. >> does it matter whether one side of the partition has a majority of nodes? >> > > Yes. Normall

Re: [akka-user] Custom Akka Remote Transport

2014-04-09 Thread Boris Capitanu
Hi Endre, I'm also interested in exploring the possibility of implementing a custom transport for Akka... We're now almost 5 months later from when you replied to Pierre... has that work on Akka IO that you were referencing been finalized? Would this be a good time to attempt such a feat? Than

Re: [akka-user] Strange timeout exception during cluster start

2014-04-09 Thread nitesh . neema
Hello, Yes. We can have processes bind to ports and able to telnet/access from outside. Even on the same cluster process which fails on listening to akka, the JMX port binds and is accessible. Regards, Nitesh On Wednesday, April 9, 2014 3:51:57 PM UTC-7, √ wrote: > > Have you tried to bind to

Re: [akka-user] Re: InvalidActorNameException when recreating actor with context.watch

2014-04-09 Thread Patrik Nordwall
On Wed, Apr 9, 2014 at 9:04 PM, Iain Hull wrote: > Hi Martynas, > > Thank you for you fix. This does indeed fix my case and I am very happy > change me code accordingly. > > However can you expand on the semantics of watch? Is it only safe to call > watch from the same actor that calls stop? O

[akka-user] Custom EventStream in Java

2014-04-09 Thread Guillermo Szeliga
Hi there, I've been trying to tackle this issue on my own but I didn't succeed so far so I hope you can help. Our new architecture requires to have a whole different logging event system (independents from Akka's) by using a LoggingAdapter instance but with a custom-tailored LogEventBus. The i

[akka-user] Re: Can one actor exists in two paths at once?

2014-04-09 Thread 何品
I am going to do something just like you,and I plan to implement an Router and register the connectionActor as routee. What do you think? 在 2014年4月9日星期三UTC+8下午7时24分25秒,Chanan Braunstein写道: > > My use case: > > I have an Actor per websocket called a User. > I have groups of user that need to be no

Re: [akka-user] Using ActorSelection to check if actor exists

2014-04-09 Thread Atom Cong
Hi, Akka experts, Patrik's solution seems make sense to me. But I couldn't figure out how to code it up, and what exactly APIs I should use to do the series of operations. Can anyone point me to a code example if there is any? Thank you very much. On Monday, February 17, 2014 2:27