I have a private Stack S which is filled with objects from out-side of the class (using methods).
A ListenableFuture should read the stack and retrieve an Object from it,
but if the stack is empty it should wait for an object to be inserted to the stack and then retrieve it. I'm not sure how to implement this.
My idea was to use Wait / Notify for the ListenableFuture but is this correct logic (working with Guava)?
What other options do I have?
Thanks in advance,
Guy