sp

package
v0.0.0-...-f7687f2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRC32

func CRC32(str string) uint32

CRC32 CRC32

func MD5

func MD5(str string) string

MD5 MD5

func SlotBalance

func SlotBalance(str string, slotCount uint32) uint32

SlotBalance SlotBalance

Types

type Broker

type Broker struct {
	// contains filtered or unexported fields
}

Broker Broker

func NewBroker

func NewBroker(slotCount uint32, broadcast func(topicID string, to map[string]*Consumer, from Session, message interface{})) *Broker

NewBroker NewBroker

func (*Broker) GetTotalConsumer

func (broker *Broker) GetTotalConsumer() map[string]uint64

GetTotalConsumer GetTotalConsumer

func (*Broker) GetTotalTopic

func (broker *Broker) GetTotalTopic() uint64

GetTotalTopic GetTotalTopic

func (*Broker) Publish

func (broker *Broker) Publish(topicID string, from Session, message interface{})

Publish Publish

func (*Broker) Subscribe

func (broker *Broker) Subscribe(topicID string, consumer *Consumer)

Subscribe Subscribe

func (*Broker) Unsubscribe

func (broker *Broker) Unsubscribe(topicID string, consumerID string)

Unsubscribe Unsubscribe

type Consumer

type Consumer struct {
	// contains filtered or unexported fields
}

Consumer Consumer

func NewConsumer

func NewConsumer(sess Session) *Consumer

NewConsumer NewConsumer

func (*Consumer) GetSession

func (c *Consumer) GetSession() Session

GetSession GetSession

func (*Consumer) Ready

func (c *Consumer) Ready(min int64)

Ready Ready

func (*Consumer) SendMarshalledData

func (c *Consumer) SendMarshalledData(data []byte, sid int64)

SendMarshalledData SendMarshalledData

type Session

type Session interface {
	Subscribe(topicID string, executeFunc func(sess Session, topicID string) error) error
	Unsubscribe(topicID string, executeFunc func(sess Session, topicID string))
	GetSessionImpl() *bi.SessionImpl
}

Session Session

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL