Subscribe a callback to an event

        Parameters
        ----------
        event : str
            Available events are 'precall', 'postcall', and 'capacity'.
            precall is called with: (connection, command, query_kwargs)
            postcall is called with: (connection, command, query_kwargs, response)
            capacity is called with: (connection, command, query_kwargs, response, capacity)
        hook : callable

def subscribe(self, event, hook):
        """
        Subscribe a callback to an event

        Parameters
        ----------
        event : str
            Available events are 'precall', 'postcall', and 'capacity'.
            precall is called with: (connection, command, query_kwargs)
            postcall is called with: (connection, command, query_kwargs, response)
            capacity is called with: (connection, command, query_kwargs, response, capacity)
        hook : callable

        """
        if hook not in self._hooks[event]:
            self._hooks[event].append(hook)