timerstore

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ConsensusVersion = 1
)
View Source
const (
	ModuleName = "timerstore"
)

Variables

This section is empty.

Functions

func TimerVersion added in v0.25.0

func TimerVersion() uint64

TimerVersion returns the timer library version

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

func NewAppModule

func NewAppModule(k *Keeper) AppModule

func (AppModule) BeginBlock

func (a AppModule) BeginBlock(context sdk.Context, _ abci.RequestBeginBlock)

func (AppModule) ConsensusVersion

func (a AppModule) ConsensusVersion() uint64

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic implements the module.AppModuleBasic interface for the downtime module.

func (AppModuleBasic) GetQueryCmd

func (a AppModuleBasic) GetQueryCmd() *cobra.Command

func (AppModuleBasic) GetTxCmd

func (a AppModuleBasic) GetTxCmd() *cobra.Command

func (AppModuleBasic) Name

func (a AppModuleBasic) Name() string

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (a AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux)

func (AppModuleBasic) RegisterInterfaces

func (a AppModuleBasic) RegisterInterfaces(_ cdctypes.InterfaceRegistry)

func (AppModuleBasic) RegisterLegacyAminoCodec

func (a AppModuleBasic) RegisterLegacyAminoCodec(_ *codec.LegacyAmino)

type Keeper added in v0.24.1

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

Keeper is the timerstore keeper. The keeper retains all the fixation stores used by modules, it also manages their lifecycle.

func NewKeeper added in v0.24.1

func NewKeeper(cdc codec.BinaryCodec) *Keeper

func (*Keeper) BeginBlock added in v0.24.1

func (k *Keeper) BeginBlock(ctx sdk.Context)

func (*Keeper) NewTimerStore added in v0.24.1

func (k *Keeper) NewTimerStore(storeKey storetypes.StoreKey, prefix string) *TimerStore

type TimerCallback added in v0.25.0

type TimerCallback func(ctx sdk.Context, key, data []byte)

TimerCallback defined the callback handler function

type TimerStore added in v0.25.0

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

TimerStore represents a timer store to manager timers and timeouts

func NewTimerStore added in v0.25.0

func NewTimerStore(storeKey storetypes.StoreKey, cdc codec.BinaryCodec, prefix string) *TimerStore

NewTimerStore returns a new TimerStore object

func (*TimerStore) AddTimerByBlockHeight added in v0.25.0

func (tstore *TimerStore) AddTimerByBlockHeight(ctx sdk.Context, block uint64, key, data []byte)

AddTimerByBlockHeight adds a new timer to expire on a given block height. If a timer for that <block, key> tuple exists, it will be overridden.

func (*TimerStore) AddTimerByBlockTime added in v0.25.0

func (tstore *TimerStore) AddTimerByBlockTime(ctx sdk.Context, timestamp uint64, key, data []byte)

AddTimerByBlockTime adds a new timer to expire on a future block with the given timestamp. If a timer for that <timestamp, key> tuple exists, it will be overridden.

func (*TimerStore) DelTimerByBlockHeight added in v0.25.0

func (tstore *TimerStore) DelTimerByBlockHeight(ctx sdk.Context, block uint64, key []byte)

DelTimerByBlockHeight removes an existing timer for the <block, key> tuple.

func (*TimerStore) DelTimerByBlockTime added in v0.25.0

func (tstore *TimerStore) DelTimerByBlockTime(ctx sdk.Context, timestamp uint64, key []byte)

DelTimerByBlockTime removes an existing timer for the <timestamp, key> tuple.

func (*TimerStore) DumpAllTimers added in v0.25.0

func (tstore *TimerStore) DumpAllTimers(ctx sdk.Context, which types.TimerType) string

DumpAllTimers dumps the details of all existing timers (of a type) into a string (for test/debug).

func (*TimerStore) Export added in v0.25.0

func (tstore *TimerStore) Export(ctx sdk.Context) []types.RawMessage

func (*TimerStore) HasTimerByBlockHeight added in v0.25.0

func (tstore *TimerStore) HasTimerByBlockHeight(ctx sdk.Context, block uint64, key []byte) bool

HasTimerByBlockHeight checks whether a timer exists for the <block, key> tuple.

func (*TimerStore) HasTimerByBlockTime added in v0.25.0

func (tstore *TimerStore) HasTimerByBlockTime(ctx sdk.Context, timestamp uint64, key []byte) bool

HasTimerByBlockTime checks whether a timer exists for the <timestamp, key> tuple.

func (*TimerStore) Init added in v0.25.0

func (tstore *TimerStore) Init(ctx sdk.Context, data []types.RawMessage)

func (*TimerStore) MigrateVersion added in v0.25.0

func (tstore *TimerStore) MigrateVersion(ctx sdk.Context) (err error)

func (*TimerStore) Tick added in v0.25.0

func (tstore *TimerStore) Tick(ctx sdk.Context)

Tick advances the timer by a block. It should be called at the beginning of each block.

func (*TimerStore) WithCallbackByBlockHeight added in v0.25.0

func (tstore *TimerStore) WithCallbackByBlockHeight(callback TimerCallback) *TimerStore

WithCallbackByBlockHeight sets a callback handler for timeouts (by block height)

func (*TimerStore) WithCallbackByBlockTime added in v0.25.0

func (tstore *TimerStore) WithCallbackByBlockTime(callback TimerCallback) *TimerStore

WithCallbackByBlockHeight sets a callback handler for timeouts (by block timestamp)

Jump to

Keyboard shortcuts

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