[sal~src:20] Optimization by dropping messages directly into the queue of the actor, r
- From: therealbean@kenai.com
- To: commits@sal.kenai.com
- Subject: [sal~src:20] Optimization by dropping messages directly into the queue of the actor, r
- Date: Mon, 23 Nov 2009 01:01:13 +0000
Project: sal
Repository: src
Revision: 20
Author: therealbean
Date: 2009-11-22 19:38:53 UTC
Link:
Log Message:
------------
Optimization by dropping messages directly into the queue of the actor,
rather than going through the registry.
Revisions:
----------
20
Modified Paths:
---------------
org/pz/sal/Sal.java
org/pz/sal/Actor.java
org/pz/sal/ActorRegistry.java
Diffs:
------
Index: org/pz/sal/Sal.java
===================================================================
--- org/pz/sal/Sal.java (revision 19)
+++ org/pz/sal/Sal.java (revision 20)
@@ -65,9 +65,8 @@
registry.send( msg );
}
- /** >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
- * Closes down Sal, by closing down the registry.
- * TODO: should place a shutdown message in all actor queues.
+ /**
+ * Sends shutdown signal to all active actors
*/
public void shutdown()
{
@@ -76,6 +75,11 @@
}
}
+ public LinkedBlockingQueue<Object> getActorQueue( final String actorName
)
+ {
+ return( registry.getActorQueue( actorName ));
+ }
+
public LinkedBlockingQueue<Object> getRegistryQueue()
{
return( registry.getQueue() );
Index: org/pz/sal/ActorRegistry.java
===================================================================
--- org/pz/sal/ActorRegistry.java (revision 19)
+++ org/pz/sal/ActorRegistry.java (revision 20)
@@ -123,6 +123,12 @@
}
}
+ public LinkedBlockingQueue<Object> getActorQueue( final String actor )
+ {
+ LinkedBlockingQueue<Object> actorQueue =
+ lookupTable.get( actor );
+ return( actorQueue );
+ }
/**
* Handle registry functions
*
Index: org/pz/sal/Actor.java
===================================================================
--- org/pz/sal/Actor.java (revision 19)
+++ org/pz/sal/Actor.java (revision 20)
@@ -39,6 +39,7 @@
"Exception in actor " + name + " constructor" ));
}
}
+ this.setSal( sal );
}
public void run()
|
[sal~src:20] Optimization by dropping messages directly into the queue of the actor, r |
therealbean | 11/23/2009 |





