Package com.bytedesk.ticket.delegate
Class ThreadQueueServiceDelegate
java.lang.Object
com.bytedesk.ticket.delegate.ThreadQueueServiceDelegate
- All Implemented Interfaces:
org.flowable.engine.delegate.JavaDelegate
@Component("threadQueueServiceDelegate")
public class ThreadQueueServiceDelegate
extends Object
implements org.flowable.engine.delegate.JavaDelegate
排队等待服务
处理客服会话中的排队机制
- 将访客加入队列
- 计算和更新排队位置
- 判断何时可以分配给客服
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate int
calculateEstimatedWaitTime
(int queuePosition) 估计等待时间(秒)void
execute
(org.flowable.engine.delegate.DelegateExecution execution) private int
模拟排队位置计算private void
simulateQueueWaiting
(int queuePosition) 模拟排队等待过程
-
Constructor Details
-
ThreadQueueServiceDelegate
public ThreadQueueServiceDelegate()
-
-
Method Details
-
execute
public void execute(org.flowable.engine.delegate.DelegateExecution execution) - Specified by:
execute
in interfaceorg.flowable.engine.delegate.JavaDelegate
-
simulateQueuePosition
private int simulateQueuePosition()模拟排队位置计算 -
calculateEstimatedWaitTime
private int calculateEstimatedWaitTime(int queuePosition) 估计等待时间(秒) -
simulateQueueWaiting
模拟排队等待过程- Throws:
InterruptedException
-