<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def emit_contextually(self, action, payload):
 """ Emit on exiting request context."""

        self.dump(action, payload)
        return g.rio_client_contextual.append((action, payload, ))