专栏名称: go4it
目录
相关文章推荐
宝鸡市场监管  ·  这样洗草莓可能农残更高!很多人都做错了…… ·  19 小时前  
江苏药品监管  ·  不是错觉!过了这个年纪,真的更容易长胖 ·  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()
}
复制代码






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