Documentation
¶
Index ¶
- Constants
- func Beat(ctx context.Context)
- func Call(ctx context.Context, frameName string, fn func(context.Context))
- func DoneOf(ctx context.Context) <-chan struct{}
- func ForcedBeat(ctx context.Context, forced bool)
- func WithFactory(ctx context.Context, name string, factory HeartbeatGeneratorFactory) context.Context
- func WithFrame(ctx context.Context, frameName string) context.Context
- func WithoutFactory(ctx context.Context) context.Context
- type Heartbeat
- type HeartbeatGenerator
- type HeartbeatGeneratorFactory
- type HeartbeatID
Constants ¶
View Source
const DisabledHeartbeat = math.MinInt64
Variables ¶
This section is empty.
Functions ¶
func ForcedBeat ¶
func WithFactory ¶
Types ¶
type Heartbeat ¶
type Heartbeat struct { From HeartbeatID PreviousUnixTime int64 UpdateUnixTime int64 }
func (Heartbeat) IsCancelled ¶
type HeartbeatGenerator ¶
type HeartbeatGenerator struct {
// contains filtered or unexported fields
}
func NewHeartbeatGenerator ¶
func NewHeartbeatGenerator(id HeartbeatID, heartbeatPeriod time.Duration, out chan<- Heartbeat) HeartbeatGenerator
func NewHeartbeatGeneratorWithRetries ¶
func NewHeartbeatGeneratorWithRetries(id HeartbeatID, heartbeatPeriod time.Duration, retryCount uint8, out chan<- Heartbeat) HeartbeatGenerator
func (*HeartbeatGenerator) Cancel ¶
func (g *HeartbeatGenerator) Cancel()
func (*HeartbeatGenerator) Disable ¶
func (g *HeartbeatGenerator) Disable()
func (*HeartbeatGenerator) ForcedHeartbeat ¶
func (g *HeartbeatGenerator) ForcedHeartbeat(forced bool)
func (*HeartbeatGenerator) Heartbeat ¶
func (g *HeartbeatGenerator) Heartbeat()
func (*HeartbeatGenerator) IsEnabled ¶
func (g *HeartbeatGenerator) IsEnabled() bool
type HeartbeatGeneratorFactory ¶
type HeartbeatGeneratorFactory interface {
CreateGenerator(name string) *HeartbeatGenerator
}
func FromContext ¶
func FromContext(ctx context.Context) (bool, HeartbeatGeneratorFactory)
type HeartbeatID ¶
type HeartbeatID uint32
Click to show internal directories.
Click to hide internal directories.