El lun, 25-10-2004 a las 10:37, James Carman escribió:
What if the service interface’s method returns something? How can it be asynchronous? Of course, asynchronous calls doesn't expect to return a value... that's the whole point. I agree that the Executor interface could be used as a service itself, but to use that idea as a service model doesn’t work IMHO. My suggestion would be to expose the Executor (or actually ExecutorService in JDK 5.0) interface as a service in your registry (as you’ve already done it seems) and let other services use it. A service model itself cannot be asynchronous, as it is a mechanism for performing a method call (which is inherently synchronous) on an object. Even when you call the Executor.execute() method, it’s a synchronous call. The method does what it’s supposed to do (adds the Runnable to a queue or something) and returns. I partially agree with you, but I think that wrapping the asynch/pool/queue behaviour in the service-model would make things a lot cleaner and shorter... no need the extra SPs, no need to implement runnable, etc... Of course the methods called with this model/s should not return any value but void.
|
- Pooled Service Model enhancements Jean-Francois Poilpret
- Re: Pooled Service Model enhancements Bob Arnott
- Re: Pooled Service Model enhancements Marcus Brito
- RE: Pooled Service Model enhancements James Carman
- RE: Pooled Service Model enhancements Pablo Lalloni
- RE: Pooled Service Model enhanceme... James Carman
- RE: Pooled Service Model enha... Pablo Lalloni
- RE: Pooled Service Model ... James Carman
- RE: Pooled Service Mo... Jean-Francois Poilpret
- Re: Pooled Service Mo... Howard Lewis Ship
