usecase

package
v0.1.20 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseProducer

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

func (*BaseProducer) InitStartHeight

func (bm *BaseProducer) InitStartHeight(ctx context.Context) error

InitStartHeight checks if the start height is zero and fetches the latest block height.

func (*BaseProducer) MonitorLoop

func (bm *BaseProducer) MonitorLoop(ctx context.Context, processBlock func(ctx context.Context, height int64) error) error

MonitorLoop allows each specific producer to define how it processes blocks or block results.

func (*BaseProducer) MonitorLoopParallel

func (bm *BaseProducer) MonitorLoopParallel(ctx context.Context, processBlock func(ctx context.Context, height int64) error, numWorkers int) error

type EventsProducer

type EventsProducer struct {
	BaseProducer
}

func NewEventsProducer

func NewEventsProducer(service domain.ProcessorService, client domain.AlloraClientInterface, repository domain.ProcessedBlockRepositoryInterface,
	startHeight int64, blockRefreshInterval time.Duration, rateLimitInterval time.Duration, numWorkers int) (*EventsProducer, error)

func (*EventsProducer) Execute

func (m *EventsProducer) Execute(ctx context.Context) error

type QueryProducer added in v0.1.10

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

func NewQueryProducer added in v0.1.10

func NewQueryProducer(processor domain.QueryProcessor, epochInterval time.Duration, rateLimitInterval time.Duration) (*QueryProducer, error)

func (*QueryProducer) Execute added in v0.1.10

func (q *QueryProducer) Execute(ctx context.Context) error

func (*QueryProducer) ProcessQueries added in v0.1.10

func (q *QueryProducer) ProcessQueries(ctx context.Context) error

type TransactionsProducer

type TransactionsProducer struct {
	BaseProducer
}

func NewTransactionsProducer

func NewTransactionsProducer(service domain.ProcessorService, client domain.AlloraClientInterface, repository domain.ProcessedBlockRepositoryInterface,
	startHeight int64, blockRefreshInterval time.Duration, rateLimitInterval time.Duration, numWorkers int) (*TransactionsProducer, error)

func (*TransactionsProducer) Execute

func (m *TransactionsProducer) Execute(ctx context.Context) error

Jump to

Keyboard shortcuts

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