Documentation ¶
Index ¶
- type ChanN
- func (p *ChanN) Close()
- func (p *ChanN) Read(datas []interface{}, block int) (ln int, closed bool)
- func (p *ChanN) Recv(n int, block int) (result []interface{}, closed bool)
- func (p *ChanN) Send(data interface{}) (full bool, closed bool)
- func (p *ChanN) SendCover(data interface{}) (full bool, closed bool)
- func (p *ChanN) SendCoverN(datas []interface{}) (n int, closed bool)
- func (p *ChanN) SendN(datas []interface{}) (n int, closed bool)
- type IChanN
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanN ¶
type ChanN struct {
// contains filtered or unexported fields
}
ChanN 顾名思义,是一次可以发送,接收N个数据的chan,特性和原生的chan类似 通过原生chan实现Recv()的阻塞!写数据只覆盖,不阻塞!
func (*ChanN) SendCoverN ¶
type IChanN ¶
type IChanN interface { Send(data interface{}) (full bool, closed bool) SendN(datas []interface{}) (n int, closed bool) Recv(n int, block int) (result []interface{}, closed bool) Read(datas []interface{}, block int) (n int, closed bool) Close() }
IChanN 用于IO和逻辑层之间传递数据可以用原生封装,也可以新建 要求:发送不阻塞,而且缓冲满了之后,要求覆盖旧的数据; 接收可选择是否阻塞
Click to show internal directories.
Click to hide internal directories.