daemon

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2016 License: GPL-2.0 Imports: 25 Imported by: 0

Documentation

Overview

*

  • Copyright 2015 @ z3q.net.
  • name : defer.go
  • author : jarryliu
  • date : 2016-01-06 17:43
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : mail_queue
  • author : jarryliu
  • date : 2015-07-27 17:06
  • description :
  • history :

*

  • Copyright 2015 @ z3q.net.
  • name : person_finance
  • author : jarryliu
  • date : 2016-04-02 10:35
  • description :
  • history :

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTickerFunc

func AddTickerFunc(f Func)

添加定时执行任务(默认5秒)

func FlagRun

func FlagRun()

自定义参数运行

func Recover

func Recover()

func RegisterService

func RegisterService(s Service)

注册服务

func Run

func Run(ctx gof.App)

运行

func Start

func Start()

启动守护进程

Types

type Func

type Func func(gof.App)

守护进程执行的函数

type Service

type Service interface {
	// 服务名称
	Name() string
	// 设置APP上下文
	SetApp(gof.App)
	// 启动服务
	Start()
	// 处理订单,需根据订单不同的状态,作不同的业务
	// 返回布尔值,如果返回false,则不继续执行
	OrderObs(*shopping.ValueOrder) bool
	// 监视会员修改,@create:是否为新注册会员
	// 返回布尔值,如果返回false,则不继续执行
	MemberObs(m *member.ValueMember, create bool) bool
	// 处理邮件队列
	// 返回布尔值,如果返回false,则不继续执行
	HandleMailQueue([]*mss.MailTask) bool
}

守护进程服务

Jump to

Keyboard shortcuts

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