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

◆ wait_callback

using xtd::threading::wait_callback = typedef delegate<void(std::any)>

Represents a callback method to be executed by a thread pool thread.

delegate< void(arguments_t...)> action
Represents a xtd::delegate that has variable parameters and does not return a value.
Definition action.h:20
delegate< void(std::any)> wait_callback
Represents a callback method to be executed by a thread pool thread.
Definition wait_callback.h:30
Header
#include <xtd/threading/wait_callback>
Namespace
xtd::threading
Library
xtd.core
Parameters
stateAn object containing information to be used by the callback method.
Remarks
xtd::threading::wait_callback represents a callback method that you want to execute on a xtd::threading::thread_pool thread. Create the delegate by passing your callback method to the xtd::threading::wait_callback constructor. Your method must have the signature shown here.
Queue the method for execution by passing the xtd::threading::wait_callback delegate to xtd::threading::thread_pool::queue_user_work_item. The callback method executes when a thread pool thread becomes available.
If you want to pass information to the callback method, create an object that contains the necessary information and pass it to the xtd::threading::thread_pool::queue_user_work_item(xtd::threading::wait_callback, xtd::object&) method as the second argument. Each time the callback method executes, the state parameter contains this object.
For examples that use the xtd::threading::wait_callback delegate, see the xtd::threading::thread_pool::queue_user_work_item method.