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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -