heartbeat

package
v0.0.0-...-80248e1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HeartBeat

type HeartBeat struct {
	WaitID uint32         // 等待的id (开始为0, 收到第一次心跳,设置随机值,并返回给用户,用户下次使用该数值)
	Second *xtimer.Second // 定时器
	Timer  xtimer.ITimer
}

func (*HeartBeat) Start

func (p *HeartBeat) Start(callback xcontrol.ICallBack, out xcontrol.IOut)

开始

callback.Parameters[0]: object 挂载对象
callback.Parameters[1]: timer xtimer.ITimer
callback.Parameters[2]: expire int64

func (*HeartBeat) Stop

func (p *HeartBeat) Stop()

type IHeartBeat

type IHeartBeat interface {
	Start(callback xcontrol.ICallBack, out xcontrol.IOut) // 开启
	Stop()                                                // 停止
	Timeout(args ...any) error
}

IHeartBeat 心跳接口

Jump to

Keyboard shortcuts

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