enginememory

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2016 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(n *node.Node, conf *Config) (engine.Engine, error)

New initializes Memory Engine.

func Plugin

func Plugin(n *node.Node, c config.Getter) (engine.Engine, error)

Types

type Config

type Config struct{}

type MemoryEngine

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

MemoryEngine allows to run Centrifugo without using Redis at all. All data managed inside process memory. With this engine you can only run single Centrifugo node. If you need to scale you should use Redis engine instead.

func (*MemoryEngine) AddPresence

func (e *MemoryEngine) AddPresence(ch string, uid string, info proto.ClientInfo, expire int) error

func (*MemoryEngine) Channels

func (e *MemoryEngine) Channels() ([]string, error)

func (*MemoryEngine) History

func (e *MemoryEngine) History(ch string, limit int) ([]proto.Message, error)

func (*MemoryEngine) Name

func (e *MemoryEngine) Name() string

func (*MemoryEngine) Presence

func (e *MemoryEngine) Presence(ch string) (map[string]proto.ClientInfo, error)

func (*MemoryEngine) PublishAdmin

func (e *MemoryEngine) PublishAdmin(message *proto.AdminMessage) <-chan error

func (*MemoryEngine) PublishControl

func (e *MemoryEngine) PublishControl(message *proto.ControlMessage) <-chan error

func (*MemoryEngine) PublishJoin

func (e *MemoryEngine) PublishJoin(message *proto.JoinMessage, opts *proto.ChannelOptions) <-chan error

func (*MemoryEngine) PublishLeave

func (e *MemoryEngine) PublishLeave(message *proto.LeaveMessage, opts *proto.ChannelOptions) <-chan error

func (*MemoryEngine) PublishMessage

func (e *MemoryEngine) PublishMessage(message *proto.Message, opts *proto.ChannelOptions) <-chan error

func (*MemoryEngine) RemovePresence

func (e *MemoryEngine) RemovePresence(ch string, uid string) error

func (*MemoryEngine) Run

func (e *MemoryEngine) Run() error

func (*MemoryEngine) Shutdown

func (e *MemoryEngine) Shutdown() error

func (*MemoryEngine) Subscribe

func (e *MemoryEngine) Subscribe(ch string) error

func (*MemoryEngine) Unsubscribe

func (e *MemoryEngine) Unsubscribe(ch string) error

Jump to

Keyboard shortcuts

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