with_connection: decorator; make sure that there is a connection available
    for action. Set the connections 'last_used' attribute to current timestamp.
    We always get a fresh connection from the CONNECTION REGISTRY since the
    'extras' could have changed.

def with_connection(func, self, *args, **argd):
    """
    with_connection: decorator; make sure that there is a connection available
    for action. Set the connections 'last_used' attribute to current timestamp.
    We always get a fresh connection from the CONNECTION REGISTRY since the
    'extras' could have changed.
    """
    self.connection = self.get_connection()
    self.connection.last_used = time.time()
    self.connection.pre_call_hook(self, func)
    return func(self, *args, **argd)