I am creating my concurrent application at the top of the GPAR library. It has a thread pool under the hood, so I would like to solve all the concurrency related work through this pool.
I need to run the job with a certain delay (like 30 seconds). Apart from this I want to do some work from time to time.
Are there any ways to implement these things with GPARS?
What about the delay for more scheduling thread.
is? I know that there are clear options, but I do not see anything wrong in using them.
I mean mixing GPRS with high order closure, eg:
@grab (group = 'org.codehaus.gpars', module =' gpars ', Version =' 1.2.1 ') def delayDecorator = {completion, delay -> Returns {Parameters -> Thread Stop sleeping. (Parameters)}} groovyx.gpars.GParsPool.withPool () {def closures = [{println it}, {println it + 1}], delay = 1000 off. Collect (Deindecorer Rcurry (Delay)). Each parallah {it (1)}}
No comments:
Post a Comment