job

package
v0.0.0-...-7d768d8 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrComet commet error.
	ErrComet = xerrors.New("comet rpc is not available")
	// ErrCometFull comet chan full.
	ErrCometFull = xerrors.New("comet proto chan full")
	// ErrRoomFull room chan full.
	ErrRoomFull = xerrors.New("room proto chan full")
)

Functions

This section is empty.

Types

type Job

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

NatsJob is push job.

func New

func New(cfg *conf.JobConfig) *Job

New new a push job.

func (*Job) Close

func (j *Job) Close() error

Close close resounces.

func (*Job) Consume

func (j *Job) Consume()

Consume messages, watch signals

func (*Job) ConsumeCheck

func (j *Job) ConsumeCheck()

ConsumeCheck messages, watch signals

func (*Job) Subscribe

func (d *Job) Subscribe(channel, channelID string) error

Subscribe get message

func (*Job) WatchComet

func (j *Job) WatchComet(c *naming.Config)

WatchComet watch commet active

type NatsJob

type NatsJob = Job

type Room

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

Room room.

func NewRoom

func NewRoom(job *Job, id string, c *conf.Room) (r *Room)

NewRoom new a room struct, store channel room info.

func (*Room) Push

func (r *Room) Push(op int32, msg []byte) (err error)

Push push msg to the room, if chan full discard it.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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