我有大约 800 个单独的 YQL 查询需要处理,并且需要很长时间

发布于 2024-10-10 00:23:17 字数 105 浏览 0 评论 0原文

是否有提示对此进行排队或暂停每个查询,以便 YQL 可以在继续下一个查询之前返回结果。我用 PHP 进行编程,每个查询大约需要 4 秒。我只是使用“while 循环”来遍历 800 个查询的数组。

Are there tips to queue this or pause each query so that YQL can return the results before moving on to the next query. I am programming this in PHP and each query takes about 4 seconds. I am just using a "while loop" to go through my array of 800 queries.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风轻花落早 2024-10-17 00:23:17

您如何在 PHP 中发送 YQL 请求?在我使用过的许多其他语言中,这些类似 CURL 的请求无论如何都是同步的,那么为什么需要主动暂停呢?

另外,在加快速度方面,您是否查看过 YQL 的 query.multi 来并行化查询? YQL 控制台示例。 尝试一下

select * from query.multi where queries="show tables;select * from feed where url='http://www.javarants.com/rss'"

How are you sending the YQL request in PHP? In a lot of other languages that I have used these CURL-like requests will be synchronous anyways, so why is there the need to pause actively?

Also in terms of speeding things up, did you look at YQL's query.multi to parallelize queries? Example for YQL console. Try it

select * from query.multi where queries="show tables;select * from feed where url='http://www.javarants.com/rss'"
世态炎凉 2024-10-17 00:23:17

针对您的问题的快速建议。我不知道你为什么要创建这么多查询,但是你可以在客户端使用 Javascripts setTimeout 吗?如果我记得正确的话,YQL 查询可以使用 javascript 完成。但如果您需要服务器端的数据,那么这不是正确的解决方案。

Quick suggestion for your problem. I don't know why you are creating so much querys, but could you use Javascripts setTimeout in client side. If I remember right YQL querys can be done with javascript. But if you need that data in server side then this isn't right solution.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文