gosockredis

package
v0.0.0-...-0e7671d Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BCData

type BCData struct {
	Event string      `json:"e"`
	Data  interface{} `json:"d"`
}

type RCData

type RCData struct {
	Room  string      `json:"r"`
	Event string      `json:"e"`
	Data  interface{} `json:"d"`
}

type Redis

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

func NewRedis

func NewRedis(ch string, p *redis.Pool) *Redis

func (*Redis) BroadcastFromBackend

func (r *Redis) BroadcastFromBackend(b chan<- *gosock.BroadcastMsg)

BroadcastFromBackend is called once and only once as a go routine as soon as the MultihomeBackend is registered using SocketServer.SetMultihomeBackend

b consumes a BroadcastMsg and dispatches it to all sockets on this server

func (*Redis) BroadcastToBackend

func (r *Redis) BroadcastToBackend(b *gosock.BroadcastMsg)

BroadcastToBackend is called everytime a BroadcastMsg is sent by a Socket

BroadcastToBackend must be safe for concurrent use by multiple go routines

func (*Redis) Init

func (r *Redis) Init()

func (*Redis) RoomcastFromBackend

func (r *Redis) RoomcastFromBackend(rr chan<- *gosock.RoomMsg)

RoomcastFromBackend is called once and only once as a go routine as soon as the MultihomeBackend is registered using SocketServer.SetMultihomeBackend

r consumes a RoomMsg and dispatches it to all sockets that are members the specified room

func (*Redis) RoomcastToBackend

func (r *Redis) RoomcastToBackend(rr *gosock.RoomMsg)

RoomcastToBackend is called everytime a RoomMsg is sent by a socket, even if none of this server's sockets are members of that room

RoomcastToBackend must be safe for concurrent use by multiple go routines

func (*Redis) Shutdown

func (r *Redis) Shutdown()

Jump to

Keyboard shortcuts

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