Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EpochTicker ¶
type EpochTicker struct {
// contains filtered or unexported fields
}
EpochTicker is a special ticker for timing epoch changes. The channel emits over the epoch interval, and ensures that the ticks are in line with the genesis time. This means that the duration between the ticks and the genesis time are always a multiple of the epoch duration. In addition, the channel returns the new epoch number.
func GetEpochTicker ¶
func GetEpochTicker(genesisTime time.Time, secondsPerEpoch uint64) *EpochTicker
GetEpochTicker is the constructor for EpochTicker.
func (*EpochTicker) C ¶
func (s *EpochTicker) C() <-chan uint64
C returns the ticker channel. Call Cancel afterwards to ensure that the goroutine exits cleanly.
func (*EpochTicker) Done ¶
func (s *EpochTicker) Done()
Done should be called to clean up the ticker.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.