daemon

package
v1.30.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2021 License: MIT Imports: 4 Imported by: 0

README

  • 我需要做什么
    守护进程

  • 如何做
    1.chan/goroutine
    2.设计守护进程模式

  • 我想要的守护进程
    1.指定任意时刻执行程序
    2.通过任务队列来执行
    3.新task来临时,队列更新(指针即可),总体维持固定携程数量进行执行

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Daemon

type Daemon struct {
	Task chan *Task // time task

	Num int // task goroutine pool num
	// contains filtered or unexported fields
}

daemon progress

func AddTask

func AddTask(params ...Param) *Daemon

AddTask

func Daemoner

func Daemoner() *Daemon

func (*Daemon) AddTask

func (d *Daemon) AddTask(params ...Param) *Daemon

add daemon task

type DaemonFunc

type DaemonFunc func()

type Param

type Param func(*Task)

func Func

func Func(daemonfunc DaemonFunc) Param

func Time

func Time(time time.CTime) Param

type Task

type Task struct {
	Time *time.CTime // ctime
	// contains filtered or unexported fields
}

type TimeTask

type TimeTask struct {
	Task
	Time time.CTime // ctime
}

Jump to

Keyboard shortcuts

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