Good stuff, thanks to you both.
I've been reading the docs and fiddling with some code and just want to check I understand correctly.
At this point I don't yet see how it's going to work, so a little patience please.
Hang on, I just found that Spring provides a ThreadPoolTaskExecutor
, so I'll use that to return the Future to the calling client, which will obviously hang on the get() until it's response is available.
The business of getting that response after it's been put into the collection for processing brings me back to the wait and notify scenario
to get the response out of the outgoing collection, so please ignore the previous post and let me know if you have something in mind to replace that wait/notify on the outgoing collection.
I'm looking around in the locks package, so I can perhaps have an exclusive write lock and a lot of concurrent reads until the response is there?