Fulib v0.1.11 Fulib.Async View Source

异步方法

Link to this section Summary

Link to this section Functions

Link to this function

pmap(collection, func, timeout \\ 5000) View Source

Link to this function

prequest(list, fun_do, opts) View Source

异步提交,有一个成功返回则停止

Params

  • list 异步提交的参数列表
  • fun_do 异步提交的函数
  • opts

    • take :: integer 从 list 中取出前多少个,默认全部
    • check_frequency :: integer 检查完成的频率,默认 50 毫秒
    • timeout :: integer 默认 5000 毫秒

Examples

iex> NetProxyLogic.get_list(https: uri.scheme == "https")
|> prequest(fn(net_proxy) ->
  opts |> Fulib.put(:net_proxy, net_proxy) |> do_request()
en3d, take5)