blocklistener

package
v1.2.11 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufferChannel

func BufferChannel(ctx context.Context, target NewBlockHashConsumer) (buffered chan *ffcapi.BlockHashEvent, done chan struct{})

BufferChannel ensures it always pulls blocks from the channel passed to the connector for new block events, regardless of whether the downstream confirmations update queue is full blocked (likely because the event stream is blocked). This is critical to avoid the situation where one blocked stream, stops another stream from receiving block events. We use the same "GapPotential" flag that the connector can mark on a reconnect, to mark when we've had to discard events for a blocked event listener (event listeners could stay blocked indefinitely, so we can't leak memory by storing up an indefinite number of new block events).

Types

type NewBlockHashConsumer

type NewBlockHashConsumer interface {
	NewBlockHashes() chan<- *ffcapi.BlockHashEvent
}

Jump to

Keyboard shortcuts

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