Code example for BlockingQueue

Methods: put

0
    private final BlockingQueue taskQueue = new LinkedBlockingQueue();
 
    @Override 
    public void storeTask(Object task) {
        try { 
            taskQueue.put(task);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        } 
    } 
 
    @Override 
    public Object takeTask() {
        try { 
            return taskQueue.take();
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        } 
    } 
 
    @Override