Documentation ¶
Overview ¶
Package pulsemanager is responsible for all pulse operations.
Index ¶
- type PulseManager
- func (m *PulseManager) Current(ctx context.Context) (*core.Pulse, error)
- func (m *PulseManager) HeavySync(ctx context.Context, pn core.PulseNumber) (core.PulseNumber, error)
- func (m *PulseManager) NextSyncPulses(ctx context.Context) (start, end core.PulseNumber, err error)
- func (m *PulseManager) Set(ctx context.Context, pulse core.Pulse) error
- func (m *PulseManager) Start(ctx context.Context) error
- func (m *PulseManager) Stop(ctx context.Context) error
- func (m *PulseManager) SyncToHeavy()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PulseManager ¶
type PulseManager struct { LR core.LogicRunner `inject:""` Bus core.MessageBus `inject:""` NodeNet core.NodeNetwork `inject:""` // contains filtered or unexported fields }
PulseManager implements core.PulseManager.
func NewPulseManager ¶
func NewPulseManager(db *storage.DB, conf configuration.PulseManager) *PulseManager
NewPulseManager creates PulseManager instance.
func (*PulseManager) HeavySync ¶ added in v0.6.3
func (m *PulseManager) HeavySync( ctx context.Context, pn core.PulseNumber, ) (core.PulseNumber, error)
HeavySync syncs records from light to heavy node, returns last synced pulse and error.
It syncs records from start to end of provided pulse numbers.
func (*PulseManager) NextSyncPulses ¶ added in v0.6.3
func (m *PulseManager) NextSyncPulses(ctx context.Context) (start, end core.PulseNumber, err error)
NextSyncPulses returns pulse numbers range for syncing to heavy node. If nothing to sync it returns 0, 0, nil.
func (*PulseManager) Start ¶ added in v0.6.3
func (m *PulseManager) Start(ctx context.Context) error
Start starts pulse manager, spawns replication goroutine under a hood.
func (*PulseManager) Stop ¶ added in v0.6.3
func (m *PulseManager) Stop(ctx context.Context) error
Stop stops PulseManager. Waits replication goroutine is done.
func (*PulseManager) SyncToHeavy ¶ added in v0.6.3
func (m *PulseManager) SyncToHeavy()
SyncToHeavy signals to sync loop there is something to sync.
Should never be called after Stop.