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
}
Click to show internal directories.
Click to hide internal directories.