1. A method comprising: generating a rule set that defines an event and that specifies one or more actions that an application running on a primary processor takes in response to the event, the event comprising a user input or a state change in a peripheral hardware component that is peripheral to the primary processor; sending the rule set from the primary processor to a secondary processor; after sending the rule set from the primary processor to a secondary processor, placing the primary processor into a sleep mode; and after the primary processor is placed in the sleep mode, handling, by the secondary processor, the event corresponding to the application by executing the rule set and performing the one or more actions, wherein handling the event corresponding to the application comprises: sending, from the secondary processor and to the primary processor, a wake command to initiate at least a partial resume of the primary processor from the sleep mode, the partial resume activating a kernel of the primary processor while preventing activation of a user space of the primary processor; and accessing, by the secondary processor, the kernel of the primary processor to handle the event and perform the one or more actions in accordance with the rule set.