collect

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

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

Go to latest
Published: Feb 5, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	None Action = iota
	NewTask
	Start
	Stop
)

type Collect

type Collect struct {
	CollectId string
	// contains filtered or unexported fields
}

func Server

func Server(handle TaskHandle) (*Collect, error)

func (*Collect) StopServer

func (c *Collect) StopServer() error

type SysTask

type SysTask struct {
	*Task
	*gnet.EventServer
	Addr       string
	Multicore  bool
	Async      bool
	Codec      gnet.ICodec
	WorkerPool *goroutine.Pool
}

func (*SysTask) OnInitComplete

func (st *SysTask) OnInitComplete(srv gnet.Server) (action gnet.Action)

func (*SysTask) React

func (st *SysTask) React(frame []byte, c gnet.Conn) (out []byte, action gnet.Action)

func (*SysTask) Start

func (st *SysTask) Start() (err error)

func (*SysTask) Stop

func (st *SysTask) Stop(ctx context.Context) (err error)

type Task

type Task struct{}

func (*Task) Start

func (t *Task) Start() (err error)

func (*Task) Stop

func (t *Task) Stop(ctx context.Context) (err error)

type TaskHandle

type TaskHandle interface {
	Start() (err error)
	Stop(ctx context.Context) (err error)
}

Jump to

Keyboard shortcuts

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