Documentation ¶
Index ¶
- Constants
- type Config
- type Pipe
- func (p *Pipe) Close() error
- func (p *Pipe) Event() uint32
- func (p *Pipe) GetPrivate() interface{}
- func (p *Pipe) ID() uint32
- func (p *Pipe) LocalAddr() string
- func (p *Pipe) Pipe() mangos.Pipe
- func (p *Pipe) RecvMsg() *mproto.Message
- func (p *Pipe) RemoteAddr() string
- func (p *Pipe) RemoteID() uint32
- func (p *Pipe) SendMsg(m *mproto.Message) error
- func (p *Pipe) SetEvent(v uint32)
- func (p *Pipe) SetPrivate(v interface{})
- func (p *Pipe) Stop()
- type Protocol
- func (s *Protocol) AddPipe(pp mproto.Pipe) error
- func (s *Protocol) Close() error
- func (s *Protocol) Exchange()
- func (s *Protocol) GetOption(option string) (interface{}, error)
- func (*Protocol) Info() mproto.Info
- func (s *Protocol) OpenContext() (mproto.Context, error)
- func (s *Protocol) Pipe(id uint32) protocol.Pipe
- func (s *Protocol) RangePipes(f func(uint32, protocol.Pipe) bool)
- func (s *Protocol) RecvMsg() (*mproto.Message, error)
- func (s *Protocol) RecvQ(hash uint32) (sizeQ chan struct{}, recvQ chan recvQEntry)
- func (s *Protocol) RemovePipe(pp mproto.Pipe)
- func (s *Protocol) SendMsg(m *mproto.Message) error
- func (s *Protocol) SetOption(name string, value interface{}) error
- func (s *Protocol) SetPipeEventHook(v protocol.PipeEventHook)
- func (s *Protocol) String() string
- type RecvQueue
- type Server
- func (s *Server) Broadcast(data []byte) error
- func (s *Server) Close() error
- func (s *Server) Listen(addr string) error
- func (s *Server) Pipe(id uint32) protocol.Pipe
- func (s *Server) RangePipes(f func(uint32, protocol.Pipe) bool)
- func (s *Server) Send(src, dest uint32, hash uint64, data []byte) error
- func (s *Server) Serve()
- func (s *Server) SetReadTimeout(v time.Duration)
- func (s *Server) SetRecvSize(v int)
- func (s *Server) SetSendSize(v int)
- func (s *Server) SetTraceMessage(trace bool)
- func (s *Server) Stop()
- func (s *Server) String() string
Constants ¶
View Source
const ( Self = protocol.ProtoEventBus Peer = protocol.ProtoEvent SelfName = "ebus" PeerName = "event" )
Protocol identity information.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Address string `json:"address" yaml:"address" toml:"address"` TraceMessage bool `json:"trace_message,omitempty" yaml:"trace_message,omitempty" toml:"trace_message,omitempty"` ExchangeLines int `json:"exchange_lines,omitempty" yaml:"exchange_lines,omitempty" toml:"exchange_lines,omitempty"` SendChanSize int `json:"send_chan_size" yaml:"send_chan_size" toml:"send_chan_size"` RecvChanSize int `json:"recv_chan_size" yaml:"recv_chan_size" toml:"recv_chan_size"` ReadTimeout time.Duration `json:"read_timeout" yaml:"read_timeout" toml:"read_timeout"` }
type Pipe ¶
type Pipe struct {
// contains filtered or unexported fields
}
func (*Pipe) GetPrivate ¶
func (p *Pipe) GetPrivate() interface{}
func (*Pipe) RemoteAddr ¶
func (*Pipe) SetPrivate ¶
func (p *Pipe) SetPrivate(v interface{})
type Protocol ¶
func NewProtocol ¶
NewProtocol returns a new protocol implementation.
func (*Protocol) RemovePipe ¶
func (*Protocol) SetPipeEventHook ¶
func (s *Protocol) SetPipeEventHook(v protocol.PipeEventHook)
type RecvQueue ¶ added in v0.2.0
type RecvQueue interface {
RecvQ(hash uint64) (recvQ chan struct{}, sizeQ chan struct{})
}
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) SetReadTimeout ¶
func (*Server) SetRecvSize ¶
func (*Server) SetSendSize ¶
func (*Server) SetTraceMessage ¶
Click to show internal directories.
Click to hide internal directories.