xtd 0.2.0
Loading...
Searching...
No Matches

◆ async_wait_handle()

virtual xtd::threading::wait_handle & xtd::iasync_result::async_wait_handle ( )
pure virtualnoexcept

Gets a xtd::threading::wait_handle that is used to wait for an asynchronous operation to complete.

Returns
A xtd::threading::wait_handle that is used to wait for an asynchronous operation to complete.
Remarks
The return value allows the client to wait for an asynchronous operation to complete instead of polling xtd::iasync_result::is_completed until the operation concludes. The return value can be used to perform a wait operation.
Notes to Implementers
The object that implements xtd::iasync_result does not need to create the xtd::threading::wait_handle until the xtd::iasync_result::async_wait_handle property is read. It is the choice of the xtd::iasync_result implementer. However, if the implementer creates xtd::iasync_result::async_wait_handle, it is the responsibility of the implementer to signal the xtd::threading::wait_handle that will terminate the wait at the appropriate time. Once created, xtd::iasync_result xtd::iasync_result::async_wait_handle should be kept alive until the user calls the method that concludes the asynchronous operation. At that time the object behind xtd::iasync_result::async_wait_handle can be discarded.
Notes to Callers
Clients that wait for the operation to complete (as opposed to polling) use this property to obtain a synchronization object to wait on.
Notes to Implementers