pool

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package pool manages event synchronization between nodes

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConfig = fmt.Errorf("invalid pool configuration")

ErrInvalidConfig indicates the pool configuration is invalid

Functions

This section is empty.

Types

type Config

type Config struct {
	// EventRate is how quickly to generate events (in milliseconds)
	EventRate int64

	// AnchorInterval is number of events before anchoring to drand beacon
	AnchorInterval int

	// SubEventComplex is probability of creating sub-events (0.0-1.0)
	SubEventComplex float64

	// VerifyInterval is events between verifications
	VerifyInterval int

	// Verbose enables detailed logging of event relationships
	Verbose bool
}

Config represents pool configuration

type Pool

type Pool interface {
	// AddEvent adds a new event to the pool
	AddEvent(ctx context.Context, data []byte, parents []string) error

	// Close closes the event pool
	Close() error
}

Pool manages a pool of events and handles event synchronization

func NewPool

func NewPool(ctx context.Context, h host.Host, d dag.DAG, b beacon.Beacon, cfg Config) (Pool, error)

NewPool creates a new event pool

Jump to

Keyboard shortcuts

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