Home Comments

C# 4.5 async await

laurialauria Member Taiyoung JangOrganization: wemade creative Co., Ltd.Project: server develop
C# 4.5 feature,
Is there any plan to support?

test.ice



interface server
{
["cs:async"] int callback();
};





test.cs




class serverPrx
{
public async Task<int> callbackAsync();
public int callback();
}




using test.cs




private async Task<int> client()
{
int rtn = await serverPrx.callbackAsync();
return rtn;
}


Comments

  • laurialauria Member Taiyoung JangOrganization: wemade creative Co., Ltd.Project: server develop
    instead of

    public static Task<Ice.AsyncResult> AsyncProcess(System.Action<Ice.AsyncCallback> send_proc)
    {
    TaskCompletionSource<Ice.AsyncResult> resultCompletionSource = new TaskCompletionSource<Ice.AsyncResult>();
    send_proc((recv_ir) => resultCompletionSource.SetResult(recv_ir));
    return resultCompletionSource.Task;
    }


    System.Action<Ice.AsyncCallback> send_process = (recv_proc) =>
    {
    prx.begin_callback(recv_proc, null);
    };
    int rtn = prx.end_callback(await AsyncProcess(send_process));
Sign In or Register to comment.