def METHOD_NAME (cpi_async_function) :
    def wrap_function (self, *args, **kwargs) :
        if 'ttype' not in kwargs :
            msg = " %s: async %s() called with no tasktype" \
                % (self.__class__.__name__, cpi_async_function.__name__)
            raise rse.BadParameter (msg)
        ttype = kwargs['ttype']
        del kwargs['ttype']
        if ttype not in (T_SYNC, T_ASYNC, T_TASK) :
            # cannot handle that ttype value, do not call async methods
            msg = " %s: async %s() called with invalid tasktype (%s)" \
                % (self.__class__.__name__, cpi_async_function.__name__,
                   str(ttype))
            raise rse.BadParameter (msg)
        cpi_sync_function_name = None
        cpi_sync_function      = None
        # find sync method flavor
        try :
            cpi_sync_function_name = re.sub ("_async$", "",
                                             cpi_async_function.__name__)
            cpi_sync_function      = getattr (self, cpi_sync_function_name)
        except AttributeError as e:
            msg = " %s: sync %s() not implemented" \
                % (self.__class__.__name__, cpi_sync_function.__name__)
            raise rse.NotImplemented (msg) from e
        # got the sync call, wrap it in a task
        c = {'_call'   : cpi_sync_function,
             '_args'   : args,
             '_kwargs' : kwargs }   # no ttype!
        return T_Task(self, cpi_sync_function_name, c, ttype)
    return wrap_function