Re: [akka-user] Idiomatic way to verify that a task will be performed by a single actor in a cluster

2017-05-08 Thread Avi Levi
Thanks !!! this is exactly what I was looking for

Sincerely,
Avi Levi
m: +972-52-3459959
<https://www.linkedin.com/in/leviavi>
https://il.linkedin.com/in/leviavi

2017-05-08 7:44 GMT+03:00 Patrik Nordwall <patrik.nordw...@gmail.com>:

> No, use Cluster Singleton http://doc.akka.io/docs/akka/
> 2.5/scala/cluster-singleton.html
>
> /Patrik
> mån 8 maj 2017 kl. 05:07 skrev AL <123...@gmail.com>:
>
>> I am starting to use AKKA cluster.
>>
>> I would like that a certain task will be performed by a single actor in
>> the cluster. If that actor is down, it should be performed by other actor.
>> I thought to accomplish that by tracking the LeaderChanged event and check
>> if the current Actor is the leader. Something like
>>
>> case LeaderChanged => if ((cluster.state.leader.map(_ == 
>> cluster.selfAddress).getOrElse(false))
>>  //do some task
>>
>> is that the idiomatic way to do it ?
>>
>> --
>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/
>> current/additional/faq.html
>> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Akka User List" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to akka-user+unsubscr...@googlegroups.com.
>> To post to this group, send email to akka-user@googlegroups.com.
>> Visit this group at https://groups.google.com/group/akka-user.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: http://doc.akka.io/docs/akka/
> current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/akka-user/8AiLKHDPcX8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> akka-user+unsubscr...@googlegroups.com.
> To post to this group, send email to akka-user@googlegroups.com.
> Visit this group at https://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
>>>>>>>>>>  Read the docs: http://akka.io/docs/
>>>>>>>>>>  Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: problem with Testing persistence actor

2015-07-09 Thread Avi Levi
Thanks , I am using the default journal .
when I run the tests from the IDE (intellij ) tthey run fine , I am getting
that error when I run tests from maven (mvn clean install or test   )

2015-07-09 22:51 GMT+03:00 Magnus Andersson magnus.anders...@mollyware.se:

 What type of journal/storage are you using?
 Perhaps you are sharing the default LevelDB journal which is meant for one
 actor only and having multiple tests trying to access it concurrently?

 I would recommend using the in memory journal found on community
 contributions page when running tests.

 /Magnus

 Den torsdag 9 juli 2015 kl. 11:35:50 UTC+2 skrev Avi:

 Hi ,
 I hope that this is the right place for this question,.
 I am trying to run tests on persistence actor - all tests pass,however
 when running all tests with maven I am getting
 [ERROR] [07/09/2015 12:18:50.410]
 [systemTest-akka.actor.default-dispatcher-4]
 [akka://systemTest/system/journal] IO error: lock  /journal/LOCK:
 already held by process
 each test class have different ActorSystem (using TestKit) , each actor
 have a unique name (e.g system.actorOf(MyActor.props(UUID)) .

 why am I still getting this lock ? what am I doing wrong ?

 Please advise
 Thanks
 Avi


  --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/akka-user/OeRJCCiCk0o/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: what is the best practice when implementing DDD following akka-persistence-eventsourcing

2015-06-24 Thread Avi Levi
Thanks you Juanjo!

2015-06-24 16:07 GMT+03:00 Juan José Vázquez Delgado 
juanjo.vazquez.delg...@tecsisa.com:

 Hi Avi,

 I've found this project [1] particularly useful in order to implement your
 DDD modeling with the use of Akka. Kudos for Paweł Kaczor. In our
 implementation, we've changed some backends, as Kafka and Cassandra instead
 of Event Store, and built some others building blocks, but this project was
 a source of inspiration for us in the beginnig of our Akka/DDD/CQRS/ES
 journey.

 BR,

 Juanjo

 [1] https://github.com/pawelkaczor/ddd-leaven-akka-v2


 El martes, 23 de junio de 2015, 17:44:00 (UTC+2), Avi escribió:

 Hi
 I saw this example at typesafe activator *akka-persistence-eventsourcing
 https://github.com/ScalaConsultants/akka-persistence-eventsourcing and it
 is really awesome ,but I have just a small question. *
 *in the project demonstrated we have the *VehicleAggregate
 https://github.com/ScalaConsultants/akka-persistence-eventsourcing/blob/master/src/main/scala/io/scalac/seed/domain/VehicleAggregate.scala
 and the userAggregate which are completely separated , but what if we
 had another aggregate, i.e DriverAggregate (the driver that handle the
 vehicle) which can accept command like :
 case class PaintYourCar(color:String) extends Command
 and should send command to the VehicleAggregate with the ChangeColor
 command .

 *what is the best practice to do that ? *

 should the DriverAggregate have a reference in it's constructor to the 
 VehicleAggregate
 actorRef ? which means that the DriverAggregateManager should have
 something like
 {
 ...
 val vehicleAggregateRef = VehicleAggregateManager
 https://github.com/ScalaConsultants/akka-persistence-eventsourcing/blob/master/src/main/scala/io/scalac/seed/service/VehicleAggregateManager.scala
 .create(id)
   override def aggregateProps(id: String) = DriverAggregate.props(id,
 vehicleAggregateRef)
 ...
 }
 but it doesn't feel very good .
 Please advise

 Avi

  --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/akka-user/Q9UGygYZjd8/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: How can we test an actor with out going http request

2015-05-31 Thread Avi Levi
Thank you Konrad .
I am not sure I got you.
IIUC you suggest to create an external service actor that will accept
messages and rout them to the proper external API and will send the
response back . if that is correct then again how can I test it ? the
testkit allow me to test incoming requests to my API .
I might didn't explain myself correctly or I am missing something .
my actor needs to call some external api . something like this :
class MyActor extends Actor {
def receive = {
case GetCities(countryCode:String) = //do http request from external
system to get the cities
 }
}





2015-06-01 1:00 GMT+03:00 Konrad Malawski kt...@typesafe.com:

 I agree with Giovanni's hints here - your domain actors should talk
 using your domain language (the messages).
 Of course you can always just create an HttpRequest message (see http
 model in the docs) if you want to send that,
 however I'd recommend to test the http things more for the routing and
 checking if the proper domain message is sent
 as reaction to such http request (check out our routing testkit:
 https://github.com/akka/akka/blob/release-2.3-dev/akka-http-testkit/src/test/scala/akka/http/scaladsl/testkit/ScalatestRouteTestSpec.scala
 ), and then test domain things with normal domain messages.

 On Mon, May 25, 2015 at 9:53 AM, Giovanni Alberto Caporaletti 
 paradi...@gmail.com wrote:

 Try to separate your login between internal business actors that you can
 unit test and a gateway sub-system to connect to external systems.
 The gateway would translate all the connection logic from the external
 domain to your internal domain, including errors and other possible
 states.  You could need to handle state and/or any kind of retry
 logic/failure compensation etc.

 The external system (http) would appear as a message-driven actor to your
 bounded context, speaking your domain language, thus being unit testable.
 The gateway subsystem will be independently integration-tested. You could
 have a mock http server in your integration tests to verify the external
 calls and the translation.

 Cheers
 G


 On Sunday, 24 May 2015 10:52:10 UTC+2, Avi wrote:

 Hi ,
 I have an actor that is sending outbound http request.
 I would like top  test that actor ,is there an option to mock that call
 ? what is the correct way for doing that ?

 Best
 Avi

  --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to the Google Groups
 Akka User List group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Cheers,
 Konrad 'ktoso' Malawski
 Akka http://akka.io/ @ Typesafe http://typesafe.com/

 --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/akka-user/-rsD467ADC4/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Re: How can we test an actor with out going http request

2015-05-31 Thread Avi Levi
Thank you very much Giovanni .
I will try to follow that
Best
Avi

2015-05-25 10:53 GMT+03:00 Giovanni Alberto Caporaletti paradi...@gmail.com
:

 Try to separate your login between internal business actors that you can
 unit test and a gateway sub-system to connect to external systems.
 The gateway would translate all the connection logic from the external
 domain to your internal domain, including errors and other possible
 states.  You could need to handle state and/or any kind of retry
 logic/failure compensation etc.

 The external system (http) would appear as a message-driven actor to your
 bounded context, speaking your domain language, thus being unit testable.
 The gateway subsystem will be independently integration-tested. You could
 have a mock http server in your integration tests to verify the external
 calls and the translation.

 Cheers
 G


 On Sunday, 24 May 2015 10:52:10 UTC+2, Avi wrote:

 Hi ,
 I have an actor that is sending outbound http request.
 I would like top  test that actor ,is there an option to mock that call ?
 what is the correct way for doing that ?

 Best
 Avi

  --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/akka-user/-rsD467ADC4/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] Is this a good way of implementing akka actor best practices

2015-05-14 Thread Avi Levi
Thank you very much , exactly what I was looking for

2015-05-14 15:56 GMT+03:00 Martynas Mickevičius 
martynas.mickevic...@typesafe.com:

 Hi Avi,

 On Sun, May 10, 2015 at 9:43 AM, Avi 123...@gmail.com wrote:

 Hi,
 I want to implement I was looking at this example taken from typesafe
 activator (spray-actor-per-request)
 http://www.typesafe.com/activator/template/spray-actor-per-request


 class RestRouting extends HttpService with Actor with PerRequestCreator {

 implicit def actorRefFactory: ActorContext = context

 def receive = runRoute(route)

 val petService = context.actorOf(Props[PetClient])
 val ownerService = context.actorOf(Props[OwnerClient])

 val route = {
  get {
path(pets) {
   parameters('names) { names =
 petsWithOwner {
GetPetsWithOwners(names.split(',').toList)
  }
}
   }
  }
 }

 def petsWithOwner(message : RestMessage): Route =
 ctx = perRequest(ctx, Props(new GetPetsWithOwnersActor(petService,
 ownerService)), message)
 }



 and I wonder if this is the best parctice to implement the actors
 creation :
 ctx = perRequest(ctx, Props(new GetPetsWithOwnersActor(petService,
 ownerService)), message)
 because I saw at the akka documentation this warning
 http://doc.akka.io/docs/akka/snapshot/scala/actors.html regarding
 creating actor within an actor :
 val props2 = Props(new ActorWithArgs(arg)) // careful, see below


 The warning is here to remind users to be careful when constructing Props.
 It is important that Props are serializable. When constructing Props
 instances inside an actor one can easily close over the surrounding actor
 instance. To avoid this, there is a recommended practice to create Props
 factory methods inside the companion object that corresponds to your actor.




 also if we define an actor within an actor
 val ownerService = context.actorOf(Props[OwnerClient])
 how can it be tested ?


 To make this testable you would need to either OwnerClient ActorRef or
 Props into the RestRouting class. You can find more information with
 examples on testing parent-child relationships
 http://doc.akka.io/docs/akka/2.3.11/scala/testing.html#Testing_parent-child_relationships
 in the Akka documentation.




 Just to make things clear - I am not criticizing, I am just trying to
 learn the best practice of implementation specially as I see the typesafe
 activator as educational source


 Best wishes
 Avi

  --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to the Google Groups
 Akka User List group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Martynas Mickevičius
 Typesafe http://typesafe.com/ – Reactive
 http://www.reactivemanifesto.org/ Apps on the JVM

 --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/akka-user/XGzZvxP_Rak/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] using actors with db queries

2015-04-17 Thread Avi Levi
Thank you very much for your replay .
actually  I am using a sort of scatter gather pattern to fetch data . each
actor should fetch part of data according to param (e.d customer ID) . and
an actor that aggregates the results applying some business logic and
stores the result in the db .

so what is the best practice to achieve that  ? should I send the
repository to each actor constructor  ? or using cake pattern or other
abstraction
  ?

Best
AL




On Fri, Apr 17, 2015 at 4:14 PM Martynas Mickevičius 
martynas.mickevic...@typesafe.com wrote:

 Hi,

 On Sun, Apr 5, 2015 at 5:10 PM, AL 123...@gmail.com wrote:

 Hi
 Just want to consult if this make sense .
 I have an actor that uses as a service to fetch data from the db .
 for accessing the DB we have a Java Spring project with hibernate and Jpa
 Repository
 what is the best participate for testings :
 the actor should receive as a parameter the repository something like
 this :
 class FooService(invoicesRepo:InvoicesRepository,...more repositories
 goes here ... ) extends Actor 
 and while testing to send mock[InvoicesRepository]

 two questions :
 is that make sense to use an actor to fetch/update data from the db
 (tried to find examples at typesafe activator templates but couldn't really
 find actors )?


 Do you have a particular reason you started to think about encapsulating
 DB access to an actor? Actors are about distribution and about
 encapsulating state that can be safely accessed concurrently. There are
 situations where one could choose to put all the code that accesses the DB
 to an actor so access to DB is only from a one thread at a time, but that
 is a very specific requirement.


 if the answer is yes - is it a good practice to send the repository to
 actor ? or is it better use dependency injection


 When sending dependencies in a message you need to make sure that your
 actor does not start handling business messages until dependencies are sent
 in. Also you will have to take care of actor restarts. Therefore passing in
 dependencies as constructor arguments require less management.



 any examples will be appreciated

 Thanks



  --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---

 You received this message because you are subscribed to the Google Groups
 Akka User List group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to akka-user+unsubscr...@googlegroups.com.


 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.




 --
 Martynas Mickevičius
 Typesafe http://typesafe.com/ – Reactive
 http://www.reactivemanifesto.org/ Apps on the JVM

 --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/akka-user/e75kStFFdVQ/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Testing actors expectMsgType[HttpResponse] with matchers gives different results when using should equal or triple equal sign '==='

2015-03-10 Thread Avi Levi
Hi,
I am not sure where is the right place to put this , but after banging my 
head against the wall trying to figure out why my tests are not working is 
expected, I thought it's worth sharing.
I have noticed that my test pass with this assertion 

expectMsgType[HttpResponse].status === StatusCodes.OK but also with this 
expectMsgType[HttpResponse].status === StatusCodes.*BadRequest *pass the test. 

I have noticed that the triple equality accepts all status codes, however using 
Should works as expected 

expectMsgType[HttpResponse].status should equal(StatusCodes.OK)


*did I do something wrong or is a bug ?*


*best *

*Avi*

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] Graceful shutdown after persists completes

2015-02-04 Thread Avi Levi
I am sending heavy rate of messages to the actor that updates it's state

for (i -0 to 10){
  persistentActor ! Cmd(foo+i)
}

and using the persistAsync like this

 val receiveCommand: Receive = {
case Cmd(data) =
  persistAsync(Evt(s${data}-${numEvents}))(updateState)
case snap  = saveSnapshot(state)
case print = println(state)
  }


how can I verify that the persistence process is completed in order to
gracefully shutdown the system ?


Thanks

Avi

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.