java - is there any way to use @Async for a method being called N amount of times but know when it processed all calls? -
ive been trying find out if possible (working spring).
what want this:
i have process, has make huuuge comparation between many records , records of database, so, because want avoid timeout exception thinking use method , call async. method take each comparation , go database see if exists or not.
it works great, , dont know , how know first method (where call aysnc method) if calls @ method finished.
is there way this?
my async method looks this:
@async future<string> mymethod(someparams){ somecode... }
thanks.
one way achieve hold of executorservice
used @async
method under hoods. can, instance, pass own executor service @async("customexecutorservicebeanname")
.
once have that, can call shutdown() , awaittermination() on executor service instance (probably within @predestroy
method).
Comments
Post a Comment