Something like this: https://github.com/jbossas/jboss-threads/blob/master/src/main/java/org/jboss/threads/OrderedExecutor.java#L48