Code example for BlockingQueue

Methods: poll

0
		// executorService 
 
		// For this we need to know which Worker needs to be implemented for the 
		// task, depending on the incomingQueue (need a registry somewhere) 
 
		I element = inBlockingQueue.poll();
		if (element != null) {
			System.out.println("polled 1 element from inQueue : map of size ");
 
			// Worker w = new Worker(element); 
			// executorService.submit(w); 
		} else { 
			System.out.println("queue empty");
		} 
	} 
}