Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion vérifier qu'un acteur a fini
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Alexis Agahi  
View profile   Translate to Translated (View Original)
 More options Mar 20 2012, 6:50 pm
From: Alexis Agahi <alexis.ag...@gmail.com>
Date: Tue, 20 Mar 2012 23:50:12 +0100
Local: Tues, Mar 20 2012 6:50 pm
Subject: Re: vérifier qu'un acteur a fini
Désolé pour ma réponse un peu breve tout a l'heure (j'étais dans les
transports avec mon telephone ;) ).

En akka tu peux t'enregister pour recevoir un message Terminated
http://doc.akka.io/docs/akka/2.0/scala/actors.html#Lifecycle_Monitori...

Sinon dans l'acteur lui meme tu peux surcharger la method postStop qui
est appelée lorsque l'acteur est arrêté.

2012/3/20 Petru Dimulescu <petru.dimule...@gmail.com>:

> Bonjour,

> j'ai un acteur qui receive() en boucle à l'infini; dans des tests je
> veux attendre que l'acteur ait fini son travail, ça me semble assez
> simple:

> j'ai donc une fonction

> def waitForSyncEngine(actor: MyActor) {
>    while (actor.mailbox_size > 0 || actor.getState ==
> Actor.State.Runnable) {
>      Thread.sleep(100)
>    }
> }

> avec

> MyActor extends Actor {
> def mailbox_size = mailboxSize
> ....
> }

> waitForSyncEngine n'est pas fiable, des fois elle retourne true alors
> que mon acteur n'a pas vraiment fini.

> Comment vous faites pour arrêter le main jusqu'à un acteur ait fini
> son travail ?

> Merci,
> Petru

--
Al

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.