thread-safe keyedqueue.