We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我使用workflow处理http请求,在这期间希望非阻塞的访问数据库,因此会出现void process(WFHttpTask *server_task)函数结束了,数据库的数据还没有访问到,同时http请求就被直接返回了,因此想知道有没有办法显式的控制http请求的返回,能让我在得到数据库数据并处理完成后,再将请求返回
The text was updated successfully, but these errors were encountered:
我用的数据库是postgresql,该如何把一个对于该数据库的访问任务添加到series里
Sorry, something went wrong.
可以的啊。使用WFCounterTask(或WFMailboxTask,相比counter可以传达一个void *的信息)把series堵住,另外一个线程的postgres任务返回之后,打开counter就可以了。可以看一下这个文档:https://github.com/sogou/workflow/blob/master/docs/about-counter.md#server%E4%B8%8E%E5%85%B6%E5%AE%83%E5%BC%82%E6%AD%A5%E5%BC%95%E6%93%8E%E7%BB%93%E5%90%88%E4%BD%BF%E7%94%A8
之前有用户实现过workflow的postgres的client,不过没有看他开源。否则就可以像mysql一样直接访问了。
你的场景确实使用WFMailboxTask会好一点,方便传递信息。
No branches or pull requests
我使用workflow处理http请求,在这期间希望非阻塞的访问数据库,因此会出现void process(WFHttpTask *server_task)函数结束了,数据库的数据还没有访问到,同时http请求就被直接返回了,因此想知道有没有办法显式的控制http请求的返回,能让我在得到数据库数据并处理完成后,再将请求返回
The text was updated successfully, but these errors were encountered: