Code example for ArrayBlockingQueue

public class labelPrinter { 
	private static String url = "http://admin.touchofmodern.local:3000/shipments/scan_label";
	public static void main(String[] args) throws Exception{
		BlockingQueue<Post> queue = new ArrayBlockingQueue<>(20);
		PostGenerator generator = new PostGenerator(queue);
		Printer printer = new Printer(queue);
		//Start generator to produce jobs in the queue 
		new Thread(generator).start();
		//Start printer to consume jobs 
		new Thread(printer).start();
		System.out.println("Both threads started");
Stop searching for code, let great code find you!  Add Codota to your java IDE