Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NonBlockingChan ¶
type NonBlockingChan struct {
// contains filtered or unexported fields
}
NonBlockingChan will drop new values when full
func NewNonBlockingChan ¶
func NewNonBlockingChan(cap int) *NonBlockingChan
NewNonBlockingChan create a new non-blocking chan
func (*NonBlockingChan) Recv ¶
func (nbCh *NonBlockingChan) Recv() (interface{}, bool)
Recv value from chan
func (*NonBlockingChan) RecvWithDeadline ¶
func (nbCh *NonBlockingChan) RecvWithDeadline(deadline time.Duration) (interface{}, bool)
RecvWithDeadline try to recv value in given duration, the value will be skipped if failed
func (*NonBlockingChan) Send ¶
func (nbCh *NonBlockingChan) Send(value interface{}) bool
Send value into chan
func (*NonBlockingChan) SendWithDeadline ¶
func (nbCh *NonBlockingChan) SendWithDeadline(value interface{}, deadline time.Duration) bool
SendWithDeadline try to send value in given duration, the value will be dropped if failed
Click to show internal directories.
Click to hide internal directories.