job

package
v0.0.0-...-50b78f6 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRoomFull = errors.New("room proto chan full")
)

Functions

This section is empty.

Types

type Job

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

Job 任务(消费KAFKA,执行指定行为)

func NewJob

func NewJob(conf *conf.Config) *Job

func (*Job) Close

func (b *Job) Close()

func (*Job) Consume

func (b *Job) Consume(msg *sarama.ConsumerMessage)

Consume messages, watch signals

func (*Job) CreateOrGetRoom

func (b *Job) CreateOrGetRoom(roomId string) *RoomJob

func (*Job) DelRoom

func (b *Job) DelRoom(roomId string)

func (*Job) SendToAll

func (b *Job) SendToAll(subId int32, speed int32, message []byte) (err error)

func (*Job) SendToRoom

func (b *Job) SendToRoom(subId int32, roomId string, batchMessage []byte) (err error)

func (*Job) SendToUser

func (b *Job) SendToUser(subId int32, serverId string, tcpSessionIds []string, message []byte) (err error)

func (*Job) Watch

func (b *Job) Watch(conf *conf.Config)

type RoomJob

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

RoomJob 房间任务

func NewRoom

func NewRoom(b *Job, roomId string) (r *RoomJob)

func (*RoomJob) SendToCh

func (r *RoomJob) SendToCh(msg []byte) error

SendToCh 向房间发送消息

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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