package
0.38.0-preview.0
Repository: https://github.com/onflow/flow-go.git
Documentation: pkg.go.dev

# README

Notifier

The Notifier implements the following state machine Notifier State Machine

The intended usage pattern is:

  • there are goroutines, aka Producers, that append work to a queue pendingWorkQueue
  • there is a number of goroutines, aka Consumers, that pull work from the pendingWorkQueue
    • they consume work until they have drained the pendingWorkQueue
    • when they find that the pendingWorkQueue contains no more work, they go back to the notifier and await notification

Notifier Usage Pattern

Note that the consumer / producer interact in a different order with the pendingWorkQueue vs the notifier:

  • the producer first drops its work into the queue and subsequently sends the notification
  • the consumer first processes elements from the queue and subsequently checks for a notification Thereby, it is guaranteed that at least one consumer routine will be notified when work is added

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
IsInvalidInputError returns whether the given error is an InvalidInputError error.
IsNetworkTransmissionError returns whether the given error is a NetworkTransmissionError error.
No description provided by the author
No description provided by the author
LogError logs the engine processing error.
No description provided by the author
No description provided by the author
NewBroadcaster creates a new Broadcaster.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewNotifier instantiates a Notifier.
No description provided by the author
NewUnit returns a new unit.
No description provided by the author

# Variables

IncompatibleInputTypeError indicates that the input has an incompatible type.

# Structs

Broadcaster is a distributor for Notifier objects.
No description provided by the author
FifoMessageStore wraps a FiFo Queue to implement the MessageStore interface.
InvalidInputError are errors for caused by invalid inputs.
No description provided by the author
No description provided by the author
NetworkTransmissionError captures the general sentinel errors upon network transmission.
Notifier is a concurrency primitive for informing worker routines about the arrival of new work unit(s).
OutdatedInputError are for inputs that are outdated.
No description provided by the author
Unit handles synchronization management, startup, and shutdown for engines.
UnverifiableInputError are for inputs that cannot be verified at this moment.

# Interfaces

MessageStore is the interface to abstract how messages are buffered in memory while waiting to be processed.
Notifiable is an interface for objects that can be notified.

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author