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 Details

    • ThreadQueueServiceDelegate

      public ThreadQueueServiceDelegate()
  • Method Details

    • execute

      public void execute(org.flowable.engine.delegate.DelegateExecution execution)
      Specified by:
      execute in interface org.flowable.engine.delegate.JavaDelegate
    • simulateQueuePosition

      private int simulateQueuePosition()
      模拟排队位置计算
    • calculateEstimatedWaitTime

      private int calculateEstimatedWaitTime(int queuePosition)
      估计等待时间(秒)
    • simulateQueueWaiting

      private void simulateQueueWaiting(int queuePosition) throws InterruptedException
      模拟排队等待过程
      Throws:
      InterruptedException