Dispatcher
2022-03-08 11:42:46 0 举报
mediapipe
作者其他创作
大纲/内容
item { GRPClientBase* node_; CalculatorContext* cc_;}
NLPGRPClient
Process()
MediaProcessorGhaphConfig
protobuf
CVGRPClient
Executor
void AddTask(TaskQueue* task_queue)virtual void Schedule(std::function<void()> task) = 0;
SwtichResponseHandler
switch_rule_;———————————————GenerateTask(&Item)
SimulationClockExecutor
Start() Schedule(std::function<void()> task)
PostProcess(){ response_handler_->GenerateTask() AddItemToQueue(Item&& item)}
RunNextTask() { GRPClientBase::Process();}
Session
session_id_session_status_verctor <GRPCClientBase*> clients_MediaProcessorGhaphConfig* gragh_config_ptr_
SessionManager
Node
GRPClientBase
stub_ResponseHandler* response_handler_;—————————————————————————————PreProcess()Process()PostProcess()
ResponseHandler
void GenerateTask(&Item)
SpeechToTextGRPClient
DefaultResponseHandler
GenerateTask(&Item)
Scheduler: init SchedulerQueue() foreach request from client:{ AddItemToQueue() SubmitWaitingTasksToExecutor(); } while(true) { if(queue_ is not empty) { SubmitWaitingTasksToExecutor() } }
TextToSpeechGRPClient
SchedulerQueue
running_count_num_pending_tasks_num_tasks_to_add_std::priority_queue<Item> queue_—————————————————AddItemToQueue(Item&& item)SubmitWaitingTasksToExecutor()virtual void RunNextTask() override
ThreadPoolExecutor
AddTask(TaskQueue* task_queue) { Schedule([task_queue] { task_queue->RunNextTask(); }); }
收藏
0 条评论
下一页
为你推荐
查看更多