Install a handler for incoming events. The handler will be called for each incoming event, and the response returned by the handler will be sent back to the sender of the event.