-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server端如何使用WFGraphNode #607
Comments
你这个想法很有意思!但是这个代码不可行。不可以用server task来产生一个graph node。 WFHttpServer server([](WFHttpTask *server_task) {
WFGraphTask *graph = WFTaskFactory::create_graph_task(nullptr);
auto http_task_01 = WFTaskFactory::create_http_task("www.baidu.com", 4, 2, http_callback);
auto http_task_02 = WFTaskFactory::create_http_task("www.bing.com", 4, 2, http_callback);
WFGraphNode& http_node_01 = graph->create_graph_node(http_task_01);
WFGraphNode& http_node_02 = graph->create_graph_node(http_task_02);
http_node_01-->http_node_02;
series_of(server_task)->push_back(graph);
}); graph是一种任务,可以添加到server task所在的series。以上代码先抓取baidu.com,再抓取bing.com,之后回复请求。如果去掉'http_node_01-->http_node_02;'这句,则相当于图里没有任何边,两个抓取并行执行,都结束之后回复请求。 |
。◕◡◕。)ノ 感谢指导 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
当我们服务器端有比较复杂的逻辑时,想用DAG构建业务逻辑
正确打开方式是怎样的呢
下面是错误代码
The text was updated successfully, but these errors were encountered: