34#ifndef API_MIP_TASK_DISPATCHER_DELEGATE_H_
35#define API_MIP_TASK_DISPATCHER_DELEGATE_H_
56 virtual void DispatchTask(
const std::string& taskId, std::function<
void()> task) = 0;
66 const std::string& taskId,
67 std::function<
void()> task,
68 const std::shared_ptr<void>& ) {
79 virtual void DispatchTask(
const std::string& taskId, std::function<
void()> task, int64_t delaySeconds) = 0;
90 const std::string& taskId,
91 std::function<
void()> task,
93 const std::shared_ptr<void>& ) {
113 const std::string& taskId,
114 std::function<
void()> task,
115 const std::shared_ptr<void>& ) {
136 virtual bool CancelTask(
const std::string& taskId,
const std::shared_ptr<void>& ) {
A class that defines the interface to the MIP SDK task dispatcher.
virtual void DispatchTask(const std::string &taskId, std::function< void()> task, int64_t delaySeconds)=0
Execute a task on a background thread with the given delay.
virtual bool CancelTask(const std::string &taskId, const std::shared_ptr< void > &)
Cancel a background task.
virtual void DispatchTask(const std::string &taskId, std::function< void()> task)=0
Execute a task on a background thread.
virtual void DispatchTask(const std::string &taskId, std::function< void()> task, int64_t delaySeconds, const std::shared_ptr< void > &)
Execute a task on a background thread with the given delay.
virtual bool CancelTask(const std::string &taskId)=0
Cancel a background task.
virtual void CancelAllTasks()=0
Cancel all background tasks.
virtual void ExecuteTaskOnIndependentThread(const std::string &taskId, std::function< void()> task, const std::shared_ptr< void > &)
Immediately execute a task on an independent thread.
virtual void ExecuteTaskOnIndependentThread(const std::string &taskId, std::function< void()> task)=0
Immediately execute a task on an independent thread.
virtual void DispatchTask(const std::string &taskId, std::function< void()> task, const std::shared_ptr< void > &)
Execute a task on a background thread.