[concurrency-interest] overview new features -> tim.

Peter Veentjer - Anchor Men p.veentjer at anchormen.nl
Tue Sep 6 03:37:24 EDT 2005


You have been asking about a usecase for the BlockingExecutor.
The someExecutorService from my threading example is A BlockingExecutor.

OutputChannel c = new DoSomeHeavyCalculatingOutputChannel(..);
BlockingExecutor blockingExecutor = new BlockingExecutor(10);//10
threads.
ActiveOutputChannel activeChannel= new
ActiveOutputChannel(c,blockingExecutor);

The someExecutor is a BlockingExecutor. That is where I need The control

for timeouts for. If a msg is offered on activeChannel, The message is 
offered with the same arguments to the blockingexecutor.

Example of put:
activeChannel.Put(msg) gives a blockingExecutor.put(new
PutterRunnable(msg));

Example of offer:
activeChannel.offer(msg,timeout,unit) gives a blockingExecutor.offer(new
PutterRunnable(msg),timeout,unit);



More information about the Concurrency-interest mailing list