pulsemanager

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package pulsemanager is responsible for all pulse operations.

Index

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) Current

func (m *PulseManager) Current(ctx context.Context) (*core.Pulse, error)

Current returns current pulse structure.

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) Set

func (m *PulseManager) Set(ctx context.Context, pulse core.Pulse) error

Set set's new pulse and closes current jet drop.

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.

Jump to

Keyboard shortcuts

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