Re: 4th addition to xwt.util: queue
Charles Goodwin <[email protected]> Fri, 07 Nov 2003 15:50:38 +0000
| Newsgroups | gmane.comp.java.xwt.widgets |
|---|---|
| Organization | XWT Foundation |
| Message-ID | <[email protected]> |
Charles Goodwin wrote:
> It is xwt.util.queue which can be used to queue anonymous functions.
>
> var myqueue = xwt.util.queue..newQueue( c, t );
> // c is the number of concurrent executions
> // t is an optional timeout
Ok, upon reflection:
o Queuing is obviously not limited to anonymous functions
o Since functions passed to queue are to be handled concurrently,
there is no need to do your own threading with them...
o ...but since there is no way to seize control of a thread, all
functions must feature appropriate xwt.thread.yield() calls
o As there is no way to interrupt a thread, sadly 'timeouts' can
not be handled by xwt.util.queue - you must do these yourself...
o ...which paves the way for 'xwt.util.timer' at some point :)
- Charlie