Implement event queue.