Design Guidelines base async pattern:
•Split single functions into
BeginXxx/EndXxx pairs with intermediate structures and explicit callback
registrations.
•Sync API:
• public RetType MethodName(
Parameters params,
OutParameters outParams );
•Async API:
• IAsyncResult BeginMethodName( //
caller explicitly calls begin/end
Parameters
params,
AsyncCallback callback, // caller must supply callback
Object state ); //
caller usu. must supply cookie
• RetType EndMethodName( //
caller explicitly calls begin/end
IAsyncResult asyncResult,
OutParameters outParams );