Skip to content

Instantly share code, notes, and snippets.

@Karry
Karry / OrderingExecutor.java
Created October 10, 2014 09:23
Java Executor that warrants task ordering for task with same key. See http://stackoverflow.com/questions/2153663
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Queue;
import java.util.concurrent.Executor;
/**
* This Executor warrants task ordering for tasks with same key (key have to implement hashCode and equal methods correctly).
*/
public class OrderingExecutor implements Executor{