{%- if callable.returns_task_value() %}
            return BoltFFIAsync.CallAsync<{{ callable.return_type }}>(
{%- else %}
            return BoltFFIAsync.CallAsyncVoid(
{%- endif %}
                () => NativeMethods.{{ native_method_name }}({{ native_call_args_async }}),
                (future, callbackData, callback) => NativeMethods.{{ ac.poll_method_name }}(future, callbackData, callback),
{%- if callable.return_kind.is_void() %}
                future =>
                {
                    FfiStatus status;
                    NativeMethods.{{ ac.complete_method_name }}(future, out status);
                    BoltFFIAsync.ThrowIfStatus(status, cancellationToken);
                },
{%- else if callable.return_kind.is_direct() %}
                future =>
                {
                    FfiStatus status;
                    {{ callable.return_type }} result = NativeMethods.{{ ac.complete_method_name }}(future, out status);
                    BoltFFIAsync.ThrowIfStatus(status, cancellationToken);
                    return result;
                },
{%- else if callable.return_kind.is_callback_handle() %}
                future =>
                {
                    FfiStatus status;
                    BoltFFICallbackHandle handle = NativeMethods.{{ ac.complete_method_name }}(future, out status);
                    BoltFFIAsync.ThrowIfStatus(status, cancellationToken);
                    return {{ callable.return_kind.callback_bridge_class() }}.Wrap(handle);
                },
{%- else if callable.return_kind.is_class_handle() %}
                future =>
                {
                    FfiStatus status;
                    IntPtr _resultHandle = NativeMethods.{{ ac.complete_method_name }}(future, out status);
                    BoltFFIAsync.ThrowIfStatus(status, cancellationToken);
{%- if callable.return_kind.class_handle_nullable() %}
                    return _resultHandle == IntPtr.Zero ? null : new {{ callable.return_kind.class_handle_class() }}(_resultHandle);
{%- else %}
                    return new {{ callable.return_kind.class_handle_class() }}(_resultHandle);
{%- endif %}
                },
{%- else %}
                future =>
                {
                    FfiStatus status;
                    FfiBuf _buf = NativeMethods.{{ ac.complete_method_name }}(future, out status);
                    try
                    {
                        BoltFFIAsync.ThrowIfStatus(status, cancellationToken);
{%- let wire_decode_statement_indent = "                        " %}
{%- include "render_csharp/callable_wire_decode_return.txt" %}
                    }
                    finally
                    {
                        NativeMethods.FreeBuf(_buf);
                    }
                },
{%- endif %}
                future => NativeMethods.{{ ac.cancel_method_name }}(future),
                future => NativeMethods.{{ ac.free_method_name }}(future),
                cancellationToken);
