phttp:通过承诺向 Typhoeus 发出并行请求

时间:2021-06-24 10:11:42
【文件属性】:
文件名称:phttp:通过承诺向 Typhoeus 发出并行请求
文件大小:5KB
文件格式:ZIP
更新时间:2021-06-24 10:11:42
Ruby PHTTP 这个 gem 使利用 promise 的思想更容易组合通过 Typhoeus hydra 发出的多个请求。 安装 $ gem install phttp 例子 require "phttp" result = PHTTP . parallel do | http | cool = http . request ( "http://example.com/cool" ) . then do | response | response . body . downcase end cow = http . request ( "http://example.com/cow" ) . then do | response | response . body . upcase end http . all ( cool , cow ) . the
【文件预览】:
phttp-master
----phttp.gemspec(896B)
----LICENSE.txt(1KB)
----lib()
--------phttp()
--------phttp.rb(2KB)
----Gemfile(49B)
----spec()
--------phttp_spec.rb(4KB)
----Rakefile(28B)
----README.md(559B)
----.gitignore(154B)

网友评论