Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BoundedChan ¶
type BoundedChan struct {
// contains filtered or unexported fields
}
BoundedChan is a thread_local handle onto a bounded channel.
func NewBounded ¶
func NewBounded(bufsz uint64) *BoundedChan
NewBounded allocates a new queue and returns a handle to that queue. Further handles are created by calling NewHandle on the result of NewBounded.
func (*BoundedChan) Dequeue ¶
func (b *BoundedChan) Dequeue() Elt
Dequeue receives an Elt from b. It blocks if there are no elements enqueued there.
func (*BoundedChan) Enqueue ¶
func (b *BoundedChan) Enqueue(e Elt)
Enqueue sends e on b. If there are already >=bound goroutines blocking, then Enqueue will block until sufficiently many elements have been received.
func (*BoundedChan) NewHandle ¶
func (b *BoundedChan) NewHandle() *BoundedChan
NewHandle creates a new handle for the given Queue.
type UnboundedChan ¶
type UnboundedChan struct {
// contains filtered or unexported fields
}
Thread-local state for interacting with an unbounded channel
func New ¶
func New() *UnboundedChan
New initializes a new queue and returns an initial handle to that queue. All other handles are allocated by calls to NewHandle()
func (*UnboundedChan) Dequeue ¶
func (u *UnboundedChan) Dequeue() Elt
Dequeue an element from the channel, will block if nothing is there
func (*UnboundedChan) Enqueue ¶
func (u *UnboundedChan) Enqueue(e Elt)
Enqueue enqueues a Elt into the channel TODO(ezrosent) enforce that e is not nil, I think we make that assumption here..
func (*UnboundedChan) NewHandle ¶
func (u *UnboundedChan) NewHandle() *UnboundedChan
NewHandle creates a new handle for the given Queue.