I am using Java collections BlockingQueue for data processing. The current code looks like
while(true){
if(queue.size() > 0)
handle(queue.take())
}
Is there a way (in Java or other frameworks) where I can process it asynchronously, like,
queue.setHandler(new Handler<E>());
somewhere down the class..
class Handler implements IHandler<E>{
void handle(E e){
handle(e)
}
}