专栏名称: go4it
目录
相关文章推荐
CDA数据分析师  ·  CDA数据人才能力模型与认证体系简介​ ·  昨天  
中国交建  ·  天山上的“南水北调” ·  11 小时前  
中国城市规划  ·  两会声音 | ... ·  昨天  
中国城市规划  ·  天下事 | “千万人口”城市+1 ·  2 天前  
51好读  ›  专栏  ›  go4it

聊聊golang的tunny

go4it  · 掘金  ·  · 2021-04-27 23:41

正文

阅读 52

聊聊golang的tunny

本文主要研究一下tunny

Worker

type Worker interface {
	// Process will synchronously perform a job and return the result.
	Process(interface{}) interface{}

	// BlockUntilReady is called before each job is processed and must block the
	// calling goroutine until the Worker is ready to process the next job.
	BlockUntilReady()

	// Interrupt is called when a job is cancelled. The worker is responsible
	// for unblocking the Process implementation.
	Interrupt()

	// Terminate is called when a Worker is removed from the processing pool
	// and is responsible for cleaning up any held resources.
	Terminate()
}
复制代码






请到「今天看啥」查看全文