implement

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCoroutineGroupInfo

func AddCoroutineGroupInfo(group define.CoGroup) error

func CloseCoroutine

func CloseCoroutine(co ICoroutine) (retErr error)

func CreateAndStartStatelessCoroutine

func CreateAndStartStatelessCoroutine(coGroup define.CoGroup, handle define.CoroutineHandle, handleArgs ...interface{}) (retErr error)

func GetAllRegisteredGroup

func GetAllRegisteredGroup() (retGroups []define.CoGroup)

func StartCoroutine

func StartCoroutine(co ICoroutine) (retErr error)

Types

type BaseGroupStats

type BaseGroupStats struct {
	Group define.CoGroup `json:"group,omitempty"`

	TotalSuccessfulCreatedNum uint64 `json:"totalSuccessfulCreatedNum,omitempty"`
	TotalFailedCreatNum       uint64 `json:"totalFailedCreatNum,omitempty"`
	TotalSuccessfulStartedNum uint64 `json:"totalSuccessfulStartedNum,omitempty"`
	TotalFailedStartNum       uint64 `json:"totalFailedStartNum,omitempty"`
	TotalCrashedScheduleNum   uint64 `json:"totalCrashedScheduleNum,omitempty"`
	TotalCompletedScheduleNum uint64 `json:"totalCompletedScheduleNum,omitempty"`
	TotalStoppedNum           uint64 `json:"totalStoppedNum,omitempty"`

	TotalSuccessfulClosedNum uint64 `json:"totalSuccessfulClosedNum,omitempty"`
	TotalFailedCloseNum      uint64 `json:"totalFailedCloseNum,omitempty"`

	TotalRunningDurationMilliseconds uint64 `json:"totalRunningDurationMilliseconds,omitempty"`
	TotalRunningDurationMicroseconds uint64 `json:"totalRunningDurationMicroseconds,omitempty"`

	//////////////////////////////////
	CurrentRunningCount uint64 `json:"currentRunningCount,omitempty"`
	//MaxRunningDuration  uint64
	AvgRunningDurationMilliseconds uint64 `json:"avgRunningDurationMilliseconds,omitempty"`
	AvgRunningDurationMicroseconds uint64 `json:"avgRunningDurationMicroseconds,omitempty"`
}

type ICoroutine

type ICoroutine interface {
	GetId() define.CoId
	GetType() define.CoType
	GetGroup() define.CoGroup
	GetStatus() define.CoStatus

	GetCreatedMilliseconds() int64
	// contains filtered or unexported methods
}

func CreateCoroutine

func CreateCoroutine(coType define.CoType, coGroup define.CoGroup, interval time.Duration,
	handle define.CoroutineHandle, handleArgs ...interface{}) (retCo ICoroutine, retErr error)

type NewCoroutineFunc

type NewCoroutineFunc func(coId define.CoId, coGroup define.CoGroup, interval time.Duration,
	handle define.CoroutineHandle, handleArgs ...interface{}) (ICoroutine, error)

type Stats

type Stats struct {
	CurrentGoroutinesCount            int              `json:"currentGoroutinesCount"`
	CurrentMonitoredGoroutinesCount   uint64           `json:"currentMonitoredGoroutinesCount"`
	CurrentUnmonitoredGoroutinesCount int              `json:"currentUnmonitoredGoroutinesCount"`
	GroupStats                        []BaseGroupStats `json:"groupStats"`
}

func FetchStats

func FetchStats() (retStats Stats)

Jump to

Keyboard shortcuts

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