DelayQueue是一个基于优先队列(PriorityQueue)实现的阻塞队列(BlockingQueue),队列中的消息的优先级是根据消息的TTL来决定的。
使用延迟队列实现定时任务调度器
参考:https://soulmachine.gitbooks.io/system-design/content/cn/task-scheduler.html
DelayQueue是一个基于优先队列(PriorityQueue)实现的阻塞队列(BlockingQueue),队列中的消息的优先级是根据消息的TTL来决定的。
使用延迟队列实现定时任务调度器
参考:https://soulmachine.gitbooks.io/system-design/content/cn/task-scheduler.html