Documentation ¶
Index ¶
- Constants
- Variables
- type HeadEvent
- type TipSetObserver
- func (h *TipSetObserver) Apply(ctx context.Context, from, to *types.TipSet) error
- func (h *TipSetObserver) Cancel(err error)
- func (h *TipSetObserver) Err() error
- func (h *TipSetObserver) HeadEvents() <-chan *HeadEvent
- func (h *TipSetObserver) Revert(ctx context.Context, from, to *types.TipSet) error
- func (h *TipSetObserver) SetCurrent(ctx context.Context, ts *types.TipSet) error
- type Watcher
- type WatcherAPI
- type WatcherOpt
Constants ¶
View Source
const ( // HeadEventRevert indicates that the event signals a reversion of a tipset from the chain HeadEventRevert = "revert" // HeadEventRevert indicates that the event signals the application of a tipset to the chain HeadEventApply = "apply" // HeadEventRevert indicates that the event signals the current known head tipset HeadEventCurrent = "current" )
Constants for HeadEvent types
Variables ¶
View Source
var ( WatcherDefaultBufferSize = 5 WatcherDefaultConfidence = 1 WatcherDefaultConcurrentWorkers = 1 WatcherDefaultTasks = tasktype.AllTableTasks )
Functions ¶
This section is empty.
Types ¶
type TipSetObserver ¶
type TipSetObserver struct {
// contains filtered or unexported fields
}
func (*TipSetObserver) Cancel ¶
func (h *TipSetObserver) Cancel(err error)
func (*TipSetObserver) Err ¶
func (h *TipSetObserver) Err() error
func (*TipSetObserver) HeadEvents ¶
func (h *TipSetObserver) HeadEvents() <-chan *HeadEvent
func (*TipSetObserver) SetCurrent ¶
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
Watcher is a task that indexes blocks by following the chain head.
func NewWatcher ¶
func NewWatcher(api WatcherAPI, indexer indexer.Indexer, name string, r *schedule.Reporter, opts ...WatcherOpt) *Watcher
NewWatcher creates a new Watcher. confidence sets the number of tipsets that will be held in a cache awaiting possible reversion. Tipsets will be written to the database when they are evicted from the cache due to incoming later tipsets.
type WatcherAPI ¶
type WatcherOpt ¶
type WatcherOpt func(w *Watcher)
func WithBufferSize ¶
func WithBufferSize(b int) WatcherOpt
func WithConcurrentWorkers ¶
func WithConcurrentWorkers(p int) WatcherOpt
func WithConfidence ¶
func WithConfidence(c int) WatcherOpt
func WithTasks ¶
func WithTasks(tasks ...string) WatcherOpt
Click to show internal directories.
Click to hide internal directories.