Is it a good practice to end method names using the old asynchronous template with "Async"?

A recent async / await template recommends specifying method names with the name "Async", such as " GetAsync () ".

Now let's say that I am using the old asynchronous template , i.e. one that has a pair of Begin / End and IAsyncResult. And I have a method that completes the call to this method, for example:

public void SendAsync(byte[] data)
{
    this.stream.BeginWrite(...);
}

Also suppose that the method EndWritepassed in BeginWriteis the same for all data, i.e. it will be a method in the same class.

In this case, is it wrong to specify this method SendAsync(), since it could be confused with the new async template?

+4
2

// // .

- , ; , , ( , ).

POV , .

, , , .

( , ): http://msdn.microsoft.com/en-us/library/xzf533w0 (v = vs .71).aspx

+6

APM ( ) BeginXXX EndXXX.

, , , IAsyncResult, void, .

APM: http://msdn.microsoft.com/en-us/library/ms228963 (v = vs .110).aspx

0

Source: https://habr.com/ru/post/1538029/


All Articles