https://github.com/deadtrickster/safe-queue is a wrapper that provides common API for thread-safe queues and mailboxes.