def METHOD_NAME(func: Callable[..., A]) -> Callable[..., None]:
    emitter = _InvokeEmitter()
    # caller 'lives' in context's thread. If context is deleted so is the
    # caller (child objects are deleted before parents). This is used to
    # achieve (of fake) connection auto-disconnect.
    caller = _InvokeCaller(context)
    caller_ref = qobjref_weak(caller)
    context_ref = qobjref_weak(context)
    def call_in_context(args, kwargs):
        context = context_ref()
        if context is not None:
            func(*args, *kwargs)
    # connection from emitter -(queued)-> caller -(direct)-> func
    emitter.sig.connect(caller.sig, type)
    caller.sig.connect(call_in_context, Qt.DirectConnection)
    def disconnect():
        caller = caller_ref()
        if caller is not None:
            caller.sig.disconnect(call_in_context)
            caller.setParent(None)  # this should delete the caller
    @wraps(func)
    def wrapped(*args, **kwargs):
        # emitter is captured in this closure. This should be the only
        # reference to it. It should ne deleted along with `wrapped`.
        emitter.sig.emit(args, kwargs)
    wrapped.disconnect = disconnect  # type: ignore
    return wrapped