Code example for LinkedBlockingQueue

Methods: put

0
	} 
 
	public void send(String message) {
		failIfNotConnected(); 
		try { 
			this.queue.put(message);
		} catch (InterruptedException ex) {
			throw new RuntimeException("Can't add message to queue",ex);
		} 
	} 
 
	public int getQueueSize() { 
		return this.queue.size();
	} 
 
	protected void failIfNotConnected() throws RuntimeException { 
		if (!this.bot.isConnected()) throw new RuntimeException("Trying to send message when no longer connected");
	} 
 
	public void run() { 
		try {