providing

package
v0.24.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package providing implements an exchange wrapper which does content providing for new blocks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exchange

type Exchange struct {
	exchange.Interface
	// contains filtered or unexported fields
}

Exchange is an exchange wrapper that calls Provide for blocks received over NotifyNewBlocks.

func New

func New(base exchange.Interface, provider provider.Provider) *Exchange

New creates a new providing Exchange with the given exchange and provider. This is a light wrapper. We recommend that the provider supports the handling of many concurrent provides etc. as it is called directly for every new block.

func (*Exchange) NotifyNewBlocks

func (ex *Exchange) NotifyNewBlocks(ctx context.Context, blocks ...blocks.Block) error

NotifyNewBlocks calls NotifyNewBlocks on the underlying provider and provider.Provide for every block after that.

Jump to

Keyboard shortcuts

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