ri

package
v2.0.0-...-489710a Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

*

  • actor reference implementation

*

  • queue reference implementation, using redis

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateActor

func CreateActor(checker Checker) tok.Actor

func CreateRedisQ

func CreateRedisQ(server, auth string) tok.Queue

Types

type Actor

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

func (*Actor) Auth

func (p *Actor) Auth(r *http.Request) (interface{}, error)

func (*Actor) BeforeReceive

func (p *Actor) BeforeReceive(uid interface{}, data []byte) ([]byte, error)

func (*Actor) BeforeSend

func (p *Actor) BeforeSend(uid interface{}, data []byte) ([]byte, error)

func (*Actor) Bye

func (p *Actor) Bye(uid interface{}, reason string) []byte

func (*Actor) OnCache

func (p *Actor) OnCache(uid interface{})

func (*Actor) OnClose

func (p *Actor) OnClose(uid interface{}, active int)

func (*Actor) OnReceive

func (p *Actor) OnReceive(uid interface{}, data []byte)

func (*Actor) OnSent

func (p *Actor) OnSent(uid interface{}, data []byte, count int)

func (*Actor) Ping

func (p *Actor) Ping() []byte

type Checker

type Checker interface {
	CheckUp(from interface{}, to string) bool
	CheckDown(target interface{}, v *kodec.Msg) bool
	Dispatch(targets []interface{}, v *kodec.Msg)
	ParseAddr(to string) ([]interface{}, error)
	Cached(uid interface{})
	Auth(r *http.Request) (interface{}, error)
	BeforeReceive(uid interface{}, data []byte) ([]byte, error)
	BeforeSend(uid interface{}, data []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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