When I call BeginExecuteReader
(SQL) does it use IO Completion Ports? What makes it to be asynchronous? Should I call it from Begin[Operation]()
or from the wrapper for IAsyncResult
constructor?
does it use IO Completion Ports
Maybe, but that's an implementation detail deep in the native SQL Client's implementation.
Remember the SQL Server ADO.NET calls into the (local) native SQL Server client which will perform communication with the server.
What makes it to be async?
Its implementation. There is more than one way to do this, from approaches which fake it (perform blocking operations with a dedicated worker thread) through to IO Completion Ports and other "true" asynchronous APIs.
Where from should I call it ?
Wherever is right for your design.
for IAsyncResult constructor?
How you use the asynchronous APIs (callback passed to BeginExecuteReader
, poll the returned IAsyncResult
's IsComplete
, wait on IAsyncResult
, convert to a Task
with TaskFactory.FromAsync
, using the Reactive Extensions with Observable.FromAsyncPattern
, or something else) is again part of the design of your code.
There are too many possibilities to give any form of guidance.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments