Code example for BlockingQueue

Methods: poll

0
	public static String genUUID() {
		return UUID.randomUUID().toString().replaceAll("-", "");
	} 
 
	public String get() {
		String uuid = uuids.poll();
		if (uuid == null) {
			return genUUID(); 
		} else { 
			return uuid;
		} 
	} 
	public static void main(String[] args) {
		for (int i = 0; i < 100; i++) {
			System.out.println(genUUID());
		} 
	} 
}