heartbeat

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ping

type Ping interface {
	// SetRate  设置心跳的频率
	SetRate(rateSecond int)
	// UseCall 使用CALL方法执行ping命令
	UseCall()
	// UsePush 使用PUSH方法执行ping命令
	UsePush()
	// Name 插件的名字
	Name() string
	// AfterNewEndpoint runs ping woker.
	AfterNewEndpoint(peer drpc.EarlyEndpoint) error
	// AfterDial initializes heartbeat information.
	AfterDial(sess drpc.EarlySession, isRedial bool) *drpc.Status
	// AfterAccept initializes heartbeat information.
	AfterAccept(sess drpc.EarlySession) *drpc.Status
	// AfterWriteCall updates heartbeat information.
	AfterWriteCall(ctx drpc.WriteCtx) *drpc.Status
	// AfterWritePush updates heartbeat information.
	AfterWritePush(ctx drpc.WriteCtx) *drpc.Status
	// AfterReadCallHeader updates heartbeat information.
	AfterReadCallHeader(ctx drpc.ReadCtx) *drpc.Status
	// AfterReadPushHeader updates heartbeat information.
	AfterReadPushHeader(ctx drpc.ReadCtx) *drpc.Status
}

Ping 插件接口

func NewPing

func NewPing(rateSecond int, useCall bool) Ping

NewPing 创建插件

type Pong

type Pong interface {
	// Name returns name.
	Name() string
	// AfterNewEndpoint runs ping woker.
	AfterNewEndpoint(endpoint drpc.EarlyEndpoint) error
	// AfterWriteCall updates heartbeat information.
	AfterWriteCall(ctx drpc.WriteCtx) *drpc.Status
	// AfterWritePush updates heartbeat information.
	AfterWritePush(ctx drpc.WriteCtx) *drpc.Status
	// AfterReadCallHeader updates heartbeat information.
	AfterReadCallHeader(ctx drpc.ReadCtx) *drpc.Status
	// AfterReadPushHeader updates heartbeat information.
	AfterReadPushHeader(ctx drpc.ReadCtx) *drpc.Status
}

Pong 心跳响应

func NewPong

func NewPong() Pong

Jump to

Keyboard shortcuts

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