Controlling Task execution order with ExecutorService

前端 未结 8 1983
一生所求
一生所求 2020-12-02 14:30

I have a process which delegates asynch tasks to a pool of threads. I need to ensure that certain tasks are executed in order. So for example

Tasks arrive in order<

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-02 14:53

    I have written my won executor service which is sequence aware. It sequences the tasks which contain certain related reference and currently inflight.

    You can go through the implementation at https://github.com/nenapu/SequenceAwareExecutorService

提交回复
热议问题