observable

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Observable

type Observable interface {
	AddObserver(Observer) error
}

type ObservableImpl

type ObservableImpl struct {

	// Observers is a list of all Observers that are currently connected
	// for now these are just the GRPC stream corresponding to the AddObserver call
	Observers []Observer
	// contains filtered or unexported fields
}

ObservableImpl provides a base implementation of the Observable interface it should be embedded in all tailpipe plugin, collection and source implementations (via collection.RowSourceImpl, source.RowSourceImpl and plugin.RowSourceImpl)

func (*ObservableImpl) AddObserver

func (p *ObservableImpl) AddObserver(o Observer) error

func (*ObservableImpl) NotifyError

func (p *ObservableImpl) NotifyError(ctx context.Context, executionId string, err error)

func (*ObservableImpl) NotifyObservers

func (p *ObservableImpl) NotifyObservers(ctx context.Context, e events.Event) error

type Observer

type Observer interface {
	Notify(context.Context, events.Event) error
}

Observer is the interface that all observers must implement

type PausableObservable added in v0.5.0

type PausableObservable interface {
	Observable
	Pause() error
	PauseProcessingOnly() error
	Resume() error
}

PausableObservable is an interface that extends Observable, providing Pause and Resume methods

type PausableObservableImpl added in v0.5.0

type PausableObservableImpl struct {
	ObservableImpl
	// contains filtered or unexported fields
}

PausableObservableImpl is an implementation of the Pausable and Observable interfaces - it overrides the NotifyObservers method to block if Pause has been called Thus, when the observer is paused, no events are sent

func (*PausableObservableImpl) BlockWhilePaused added in v0.5.0

func (p *PausableObservableImpl) BlockWhilePaused(ctx context.Context)

func (*PausableObservableImpl) NotifyObservers added in v0.5.0

func (p *PausableObservableImpl) NotifyObservers(ctx context.Context, e events.Event) error

func (*PausableObservableImpl) Pause added in v0.5.0

func (p *PausableObservableImpl) Pause() error

Pause pauses the observable, preventing any events from being sent to observers

func (*PausableObservableImpl) PauseProcessingOnly added in v0.5.0

func (p *PausableObservableImpl) PauseProcessingOnly() error

PauseProcessingOnly pauses the observable's processing but allows events to continue being published

func (*PausableObservableImpl) Resume added in v0.5.0

func (p *PausableObservableImpl) Resume() error

Resume resumes the observable, allowing events to be sent to observers

Jump to

Keyboard shortcuts

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