watcher

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package watcher provides a watcher to watch the epoch.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel chan *Epoch

Channel is a channel of epoch watchers.

func (Channel) Add

func (w Channel) Add(epoch uint64, closeCh <-chan struct{}) *Epoch

Add adds a epoch watcher. It returns nil if the channel is closed.

type Epoch

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

Epoch is a epoch watcher. It will be notified when the epoch is reached.

func (*Epoch) Watch

func (e *Epoch) Watch() <-chan struct{}

Watch returns a channel that will be notified when the epoch is reached.

type Epochs

type Epochs []*Epoch

Epochs is a list of epoch watchers.

func (*Epochs) Add

func (e *Epochs) Add(epoch *Epoch)

Add adds a epoch watcher.

func (*Epochs) Notify

func (e *Epochs) Notify(epoch uint64)

Notify notifies all epoch watchers that the epoch is reached.

Jump to

Keyboard shortcuts

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