class PromiseProxy extends Promise<R> implements Message<T, R>, ActionHandle, ResultListener<R> {

    @Override
    public Promise<R> invoke(@NonNull T impl) {
        Promise<R> result = mMessage.invoke(impl);
        if (result != null) {
            ResultListener<R> listener = mListener;

            if (listener != null && mActorThread != null) {
                result.then(mActorThread, this);
            } else {
                mListener = null;
                //noinspection ConstantConditions
                result.then(listener);
            }
        }
        mActorThread = null;
        return null;
    }

      PromiseProxy(@NonNull MessageSender sender, @NonNull Message<T, R> message);

}