diff --git a/src/java/com/samskivert/util/Invoker.java b/src/java/com/samskivert/util/Invoker.java index 4f9cd9fa..c7ce0796 100644 --- a/src/java/com/samskivert/util/Invoker.java +++ b/src/java/com/samskivert/util/Invoker.java @@ -136,6 +136,14 @@ public class Invoker extends LoopingThread * Creates an invoker that will post results to the supplied result receiver. */ public Invoker (String name, RunQueue resultReceiver) + { + this(name, new RunQueue.AsExecutor(resultReceiver)); + } + + /** + * Creates an invoker that will post results to the supplied result receiver. + */ + public Invoker (String name, Executor resultReceiver) { super(name); _receiver = resultReceiver; @@ -211,7 +219,7 @@ public class Invoker extends LoopingThread willInvokeUnit(unit, start); if (unit.invoke()) { // if it returned true, post it to the receiver thread for result processing - _receiver.postRunnable(unit); + _receiver.execute(unit); } didInvokeUnit(unit, start); @@ -337,7 +345,7 @@ public class Invoker extends LoopingThread protected Queue _queue = new Queue(); /** The result receiver with which we're working. */ - protected RunQueue _receiver; + protected Executor _receiver; /** Tracks the counts of invocations by unit's class. */ protected HashMap _tracker = new HashMap();