![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
后台
superchen98
这个作者很懒,什么都没留下…
展开
-
一个完整的协程示例 让你了解 协程 管道 select的使用方法
代码逻辑 使用开启十个协程处理生产数据,一个协程来处理数据。 当处理数据的协程挂掉的时候。生产的协程也需要停止生产。 主线程需要知道 消费者是正常消费还是异常退出,方便做出对应的处理。 示例代码 package main import ( "log" "runtime" "runtime/debug" "sync" "time" ) type TempStruct struct { Num int } func main() { var wg sync.WaitGroup //缓冲.原创 2021-12-20 17:39:15 · 340 阅读 · 0 评论 -
09 Springboot定时
Spring Boot定时任务 Scheduled定时任务器 是spring3.0以后自带的定时任务器 scheduled坐标 必须添加Scheduled坐标 完成依赖注入 <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-su...原创 2020-05-03 19:50:06 · 445 阅读 · 0 评论