https://talks.golang.org/2013/advconc.slide#5

It's easy to go, but how to stop?

Long-lived programs need to clean up.

Let's look at how to write programs that handle communication, periodic events, and cancellation.

The core is Go's select statement: like a switch, but the decision is made based on the ability to communicate.

select {
case xc <- x:
// sent x on xc
case y := <-yc:
// received y from yc
}

Advanced Go Concurrency Patterns的更多相关文章

  1. 16 Go Concurrency Patterns: Timing out, moving on GO并发模式: 超时, 继续前进

    Go Concurrency Patterns: Timing out, moving on  GO并发模式: 超时, 继续前进 23 September 2010 Concurrent progra ...

  2. Go Concurrency Patterns: Pipelines and cancellation

    https://blog.golang.org/pipelines Go Concurrency Patterns: Pipelines and cancellation Sameer Ajmani1 ...

  3. Go Concurrency Patterns: Context At Google, we require that Go programmers pass a Context parameter as the first argument to every function on the call path between incoming and outgoing requests.

    小结: 1. Background is the root of any Context tree; it is never canceled: 2.     https://blog.golang. ...

  4. PAT Advanced 1071 Speech Patterns (25 分)

    People often have a preference among synonyms of the same word. For example, some may prefer "t ...

  5. golang语言中的context详解,Go Concurrency Patterns: Context

    https://blog.golang.org/context Introduction In Go servers, each incoming request is handled in its ...

  6. Go Concurrency Patterns: Timing out, moving on

    https://blog.golang.org/go-concurrency-patterns-timing-out-and

  7. 【翻译】Context should go away for Go 2

    2017/08/06   每次blog.golang.org更新博客,我都迫不及待去读一下:最新的一篇, Contributors Summit,记录了Go贡献者们的一些讨论.我读到一句话,让我感觉得 ...

  8. 33 Introducing the Go Race Detector

    Introducing the Go Race Detector 26 June 2013 Introduction Race conditions are among the most insidi ...

  9. go语言 documentation

    Documentation文档   The Go programming language is an open source project to make programmers more pro ...

随机推荐

  1. 【命令】vmstat命令和pmap命令

    博客链接地址:https://www.cnblogs.com/l75790/articles/9197733.html

  2. Git 是如何存储文件的

    01.存储方式 Git 从核心上来看不过是简单地存储键值对(key-value).它允许插入任意类型的内容,并会返回一个键值,通过该键值可以在任何时候再取出该内容. Git 存储数据内容的方式,为每份 ...

  3. 解决Idea中没有SVN标识,不能提交、更新代码

    使用idea也不久,今天从svn上down下来的项目导入idea,发现写的代码不能在idea里面更新,记录下解决方案. 步骤 1.点击VCS,然后Enable Version Control Inte ...

  4. Eclipse中,No compiler is provided in this environment. Perhaps you are running on a JRE rather than a

    问题说明 Eclipse导入Maven项目后,执行 mvn clean install后,出现如下错误: [INFO] ---------------------------------------- ...

  5. JVM调试说明

    -XX:+<option>:表示开启option选项 -XX:-<option>:表示关闭option选项 -XX:<option>=<value>:表 ...

  6. Failed to create Spark client for Spark session

    最近在hive里将mr换成spark引擎后,执行插入和一些复杂的hql会触发下面的异常: org.apache.hive.service.cli.HiveSQLException: Error whi ...

  7. 关于vuex的数据不直接给data而要通过computed

    # 为什么vuex的数据不直接给data而要通过computed计算 ## 疑惑 其实一直以来使用vue的状态管理vuex都有一个疑惑,文档中介绍,vue的状态数据`$store.state.xx`的 ...

  8. 【MySQL 基础】MySQL必知必会

    MySQL必知必会 简介 <MySQL必知必会>的学习笔记和总结. 书籍链接 了解SQL 数据库基础 什么是数据库 数据库(database):保存有组织的数据的容器(通常是一个文 件或一 ...

  9. Centos 安装 Node-v12.17.0-linux-x64.tar.gz

    wget https://nodejs.org/dist/v12.17.0/node-v12.17.0-linux-x64.tar.gz tar -zxf node-v12.17.0-linux-x6 ...

  10. 【Git】5、Git如何提交代码到远程仓库

    提交代码:如何把修改后的代码提交到远程仓库 文章目录 提交代码:如何把修改后的代码提交到远程仓库 1.同步远程代码 2.检查改动文件 3.添加文件到缓存 4.提交代码 5.推送代码 6.我的整个流程 ...