Documentation
¶
Index ¶
- type Group
- func (g *Group) Add(memberChannel chan interface{}) *Member
- func (g *Group) Broadcast(timeout time.Duration)
- func (g *Group) Close()
- func (g *Group) Join() *Member
- func (g *Group) Leave(leaving *Member) error
- func (g *Group) MemberCount() int
- func (g *Group) Members() []*Member
- func (g *Group) Send(val interface{})
- type Item
- type Member
- type Message
- type PriorityQueue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group provides a mechanism for the broadcast of messages to a collection of channels.
func (*Group) Broadcast ¶
Broadcast messages received from one group member to others. If incoming messages not arrived during `timeout` then function returns.
func (*Group) Join ¶
Join returns a new member object and handles the creation of its output channel.
func (*Group) MemberCount ¶
MemberCount returns the number of members in the Broadcast Group.
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
An Item is something we manage in a priority queue.
type Member ¶
type Member struct { Read chan interface{} // contains filtered or unexported fields }
Member represents member of a Broadcast group.
func (*Member) Close ¶
func (m *Member) Close()
Close removes the member it is called on from its broadcast group.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is an internal structure to pack messages together with info about sender.
type PriorityQueue ¶
type PriorityQueue []*Item
A PriorityQueue implements heap.Interface and holds Items.
func (PriorityQueue) Len ¶
func (pq PriorityQueue) Len() int
func (PriorityQueue) Less ¶
func (pq PriorityQueue) Less(i, j int) bool
func (*PriorityQueue) Pop ¶
func (pq *PriorityQueue) Pop() interface{}
func (*PriorityQueue) Push ¶
func (pq *PriorityQueue) Push(x interface{})
func (PriorityQueue) Swap ¶
func (pq PriorityQueue) Swap(i, j int)