processor

package
v0.0.0-...-1b33b2a Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package processor implements the processor logic based on ETCD worker(pkg/orchestrator).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitMetrics

func InitMetrics(registry *prometheus.Registry)

InitMetrics registers all metrics used in processor

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager is a manager of processor, which maintains the state and behavior of processors

func NewManager

func NewManager() *Manager

NewManager creates a new processor manager

func (*Manager) AsyncClose

func (m *Manager) AsyncClose()

AsyncClose sends a close signal to Manager and closing all processors

func (*Manager) SyncClose

func (m *Manager) SyncClose()

SyncClose closes all processors Note: This method must not be called with `Tick`!!!

func (*Manager) Tick

func (m *Manager) Tick(stdCtx context.Context, state orchestrator.ReactorState) (nextState orchestrator.ReactorState, err error)

Tick implements the `orchestrator.State` interface the `state` parameter is sent by the etcd worker, the `state` must be a snapshot of KVs in etcd the Tick function of Manager create or remove processor instances according to the specified `state`, or pass the `state` to processor instances

func (*Manager) WriteDebugInfo

func (m *Manager) WriteDebugInfo(w io.Writer)

WriteDebugInfo write the debug info to Writer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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