我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

使用Go并行读取许多URL

I'm very new to Go-language. And I have a task:

Read 10 (for example) urls: "http://... file.xml" "http://... file2.xml" ... and so on.

They must be read in parallel. And then processed by function. If URL's response takes too long - it must be ignored. (For example after 1 second).

Thank you!

Meta answer: Work through all the stuff on http://golang.org/doc and have a special look at "Go Concurrency Patterns".

近期文章

  • 我如何在Vue JS中使用Hugo模板
  • 无法在Visual Studio代码中调试Go
  • 未捕获到的SyntaxError:意外令牌<
  • Android-单选按钮的值设定
  • 使用Go从html解析列表项
  • 根据相似度最高的值对字典列表进行排序
  • Golang时间格式化为特定时间戳
  • 从goroutine更改变量
  • golang和地图中的URL查询字符串
  • 简单的转到指针说明
  • 不能用方法遍历struct吗?
  • 在Golang中找不到导入的软件包
  • 在单值上下文中使用多值
  • 在golang中编写通用函数的良好做法
  • 在Docker构建期间无法`获取`依赖项
  • 开始时遇到麻烦。 `package main`抛出运行时错误-索引超出范围?
  • 接口转换:接口{}是int64,不是[] uint8
  • 如何创建一个函数以接受来自任何结构的任何对象的任何调用?
  • 在数据库Golang中保存错误
  • 接口未实现错误(缺少Error方法)

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华