import com.lowgcqueue.LowGCQueue; public class BigDataProcessor { private LowGCQueue<String> dataQueue; public BigDataProcessor() { dataQueue = new LowGCQueue<>(); } public void processData(String data) { dataQueue.enqueue(data); } public void startProcessing() { Thread processingThread = new Thread(() -> { while (true) { String data = dataQueue.dequeue(); // ... if (data == null) { try { Thread.sleep(100); } catch (InterruptedException e) { e.printStackTrace(); } } } }); processingThread.start(); } }


上一篇:
下一篇:
切换中文