zbrun

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

异步编程抽象模型

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOS added in v1.0.3

func GetOS() string

func MainStartup added in v1.0.3

func MainStartup(workdir string, initchild func()) func()

func MainWait added in v1.0.3

func MainWait(getio GetIOinfo)

func NewTimerMgr

func NewTimerMgr() any

Types

type AsynExer

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

func (*AsynExer) AsynExec

func (this *AsynExer) AsynExec(fun func()) (isasyn bool)

AsynExec 异步执行,suspend_milsec=0为尽量立即执行,suspend_milsec>0为挂起suspend_milsec毫秒后再执行

func (*AsynExer) AsynRetExec

func (this *AsynExer) AsynRetExec(delayfunc func(deferfunc func())) (isasyn bool)

AsynRetExec 异步返回执行

type Atomint

type Atomint interface {
	Load() int32
	Store(val int32)
	CompareAndSwap(old, new int32) (swapped bool)
}

type GetIOinfo added in v1.0.3

type GetIOinfo interface {
	GetSockNum() int
	GetSendBytes() int64
	GetRecvBytes() int64
}

type IOServer

type IOServer interface {
	GetRefCount() *zbsync.Int32
	GetExitFlag() *zbsync.Int32

	SetReqChan(chan func())
}

type Runner

type Runner interface {
	Atomint
	TimerMgr
	Start(n_concurrency int, ioss ...IOServer)
	Stop(wait4exit bool, after_exit func())
	PostFun(fun func())
}

func NewRunner

func NewRunner() Runner

type TimerMgr

type TimerMgr interface {
	BeginTimer(interval uint, occfunc func() bool)
	RegetNextTimer(pp_timer *any) (delay time.Duration, tmrexefunc func())
	TmMgrClose(wait bool)
}

Jump to

Keyboard shortcuts

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