commiter

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package commiter contains implementations of committers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Instant

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

Instant Commiter adds commit after every single received commit

func NewInstant

func NewInstant(headManager thead.Manager, messageStorage storage.MessageStorage, pinner sentinel.Pinner,
	ipnsManager ipns.Manager) *Instant

func (*Instant) Add

func (i *Instant) Add(ctx context.Context, cid cid.Cid) error

type IntervalCommitter added in v1.0.2

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

IntervalCommitter adds commit at given intervals.

func NewIntervalCommitter added in v1.0.2

func NewIntervalCommitter(headManager thead.Manager, messageStorage storage.MessageStorage, pinner sentinel.Pinner,
	ipnsManager ipns.Manager, ticker *clock.Ticker) *IntervalCommitter

func (*IntervalCommitter) Add added in v1.0.2

func (i *IntervalCommitter) Add(ctx context.Context, cid cid.Cid) error

type MaxBufferCommiterConfig added in v1.2.0

type MaxBufferCommiterConfig struct {
	MaxBufferSize int           `envconfig:"COMMITER_MAX_BUFFER_SIZE" default:"1000"`
	Interval      time.Duration `envconfig:"COMMITER_INTERVAL" default:"1m"`
}

type MaxBufferCommitter added in v1.0.2

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

MaxBufferCommitter adds commit after buffer is filled. If it's not filled for a long time, it adds commit after a specified interval.

func NewMaxBufferCommitter added in v1.0.2

func NewMaxBufferCommitter(
	headManager thead.Manager,
	messageStorage storage.MessageStorage,
	pinner sentinel.Pinner,
	ipnsManager ipns.Manager,
	config MaxBufferCommiterConfig) *MaxBufferCommitter

NewMaxBufferCommitter returns a new instance of MaxBufferCommitter.

func (*MaxBufferCommitter) Add added in v1.0.2

func (mbc *MaxBufferCommitter) Add(ctx context.Context, cid cid.Cid) error

Jump to

Keyboard shortcuts

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