Documentation ¶
Overview ¶
*
- actor reference implementation
*
- queue reference implementation, using redis
Index ¶
- func CreateActor(checker Checker) tok.Actor
- func CreateRedisQ(server, auth string) tok.Queue
- type Actor
- func (p *Actor) Auth(r *http.Request) (interface{}, error)
- func (p *Actor) BeforeReceive(uid interface{}, data []byte) ([]byte, error)
- func (p *Actor) BeforeSend(uid interface{}, data []byte) ([]byte, error)
- func (p *Actor) Bye(uid interface{}, reason string) []byte
- func (p *Actor) OnCache(uid interface{})
- func (p *Actor) OnClose(uid interface{}, active int)
- func (p *Actor) OnReceive(uid interface{}, data []byte)
- func (p *Actor) OnSent(uid interface{}, data []byte, count int)
- func (p *Actor) Ping() []byte
- type Checker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateActor ¶
func CreateRedisQ ¶
Types ¶
type Actor ¶
type Actor struct {
// contains filtered or unexported fields
}
func (*Actor) BeforeReceive ¶
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) }
Click to show internal directories.
Click to hide internal directories.