mailbox

The lowest level of the proxying system. Other threads can enqueue messages on the mailbox and notify this thread to asynchronously process them once it returns to its event loop. When this thread is shut down, the mailbox is closed (see below) to prevent further messages from being enqueued and all the remaining queued messages are dequeued and their shutdown handlers are executed. This allows other threads waiting for their messages to be processed to be notified that their messages will not be processed after all.