This defines the Messenger class, which is responsible for most of the :ref:`event handling <event-handlers>` that happens on the Python side.