Documentation ¶
Index ¶
- func RetainBinary(r *MessageReader)
- type Handler
- type InternalNode
- func (i *InternalNode) ConsumeB(v bufferex.Binary)
- func (i *InternalNode) ConsumeNB(v bufferex.Binary)
- func (i *InternalNode) GetBroadcasts(overhead, limit int) [][]byte
- func (i *InternalNode) Initialize()
- func (i *InternalNode) LocalState(join bool) []byte
- func (i *InternalNode) MergeRemoteState(buf []byte, join bool)
- func (i *InternalNode) NodeMeta(limit int) []byte
- func (i *InternalNode) NotifyJoin(node *memberlist.Node)
- func (i *InternalNode) NotifyLeave(node *memberlist.Node)
- func (i *InternalNode) NotifyMsg(b []byte)
- func (i *InternalNode) NotifyUpdate(node *memberlist.Node)
- type MessageBuffer
- type MessageReader
- type NodeMeta
- type SendType
- type WrapNode
- func (w *WrapNode) Initialize()
- func (w *WrapNode) Lookup(name string) *memberlist.Node
- func (w *WrapNode) PostStart()
- func (w *WrapNode) PreStart()
- func (w *WrapNode) SendSelf(msg []byte)
- func (w *WrapNode) SendTo(st SendType, to *memberlist.Node, msg []byte) error
- func (w *WrapNode) SetCfg(cfg *memberlist.Config)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RetainBinary ¶
func RetainBinary(r *MessageReader)
Types ¶
type Handler ¶
type Handler func(w *WrapNode, d *MessageReader, msg bufferex.Binary) bool
Returns true, if further processing should be done.
If the implementor wants to retain the msg value it needs to call:
mlst.RetainBinary(d)
on the message-reader 'd'.
type InternalNode ¶
type InternalNode struct { Metadata []byte Tlq memberlist.TransmitLimitedQueue Msg chan bufferex.Binary Nodes sortlist.Sortlist AsyncHooks []memberlist.EventDelegate SyncHooks []memberlist.EventDelegate }
func (*InternalNode) ConsumeB ¶
func (i *InternalNode) ConsumeB(v bufferex.Binary)
func (*InternalNode) ConsumeNB ¶
func (i *InternalNode) ConsumeNB(v bufferex.Binary)
func (*InternalNode) GetBroadcasts ¶
func (i *InternalNode) GetBroadcasts(overhead, limit int) [][]byte
This impl. just opportunistically calls into Tlq
func (*InternalNode) Initialize ¶
func (i *InternalNode) Initialize()
func (*InternalNode) LocalState ¶
func (i *InternalNode) LocalState(join bool) []byte
func (*InternalNode) MergeRemoteState ¶
func (i *InternalNode) MergeRemoteState(buf []byte, join bool)
func (*InternalNode) NodeMeta ¶
func (i *InternalNode) NodeMeta(limit int) []byte
func (*InternalNode) NotifyJoin ¶
func (i *InternalNode) NotifyJoin(node *memberlist.Node)
func (*InternalNode) NotifyLeave ¶
func (i *InternalNode) NotifyLeave(node *memberlist.Node)
func (*InternalNode) NotifyMsg ¶
func (i *InternalNode) NotifyMsg(b []byte)
func (*InternalNode) NotifyUpdate ¶
func (i *InternalNode) NotifyUpdate(node *memberlist.Node)
type MessageBuffer ¶
func (*MessageBuffer) Init ¶
func (m *MessageBuffer) Init() *MessageBuffer
func (*MessageBuffer) Reset ¶
func (m *MessageBuffer) Reset() *MessageBuffer
type MessageReader ¶
type MessageReader struct { *msgpack.Decoder *bytes.Buffer // contains filtered or unexported fields }
func ReadMessage ¶
func ReadMessage(b []byte) *MessageReader
type NodeMeta ¶
func DecodeNodeMeta ¶
type SendType ¶
type SendType uint
const ( ST_BestFit SendType = iota // Use best method. ST_Datagram // Use Datagram. Suited for small messages that fit in one packet. ST_Reliable // Use Reliable tramsmission (TCP). ST_NoDatagram // Use best method, that is not Datagram // The folloring methods are kind of Meta-variants. ST_Fast // Use the fastest method. ST_Stable // Use the most stable method )
type WrapNode ¶
type WrapNode struct { Name string Meta NodeMeta Deleg InternalNode Membl *memberlist.Memberlist Handlers map[uint64]Handler }
Start Sequence:
wn := new(WrapNode) wn.Initialize() wn.SetCfg(cfg) // set memberlist config (sets cfg.Delegate, etc...) // Add any Plugins wn.PreStart() // start/create memberlist wn.PostStart()
func (*WrapNode) Initialize ¶
func (w *WrapNode) Initialize()
func (*WrapNode) PostStart ¶
func (w *WrapNode) PostStart()
Called, after the memberlist has been created.
func (*WrapNode) PreStart ¶
func (w *WrapNode) PreStart()
Called, before the memberlist has been created.
func (*WrapNode) SetCfg ¶
func (w *WrapNode) SetCfg(cfg *memberlist.Config)
Click to show internal directories.
Click to hide internal directories.