Documentation
¶
Index ¶
- type Observable
- type ObservableImpl
- type Observer
- type PausableObservable
- type PausableObservableImpl
- func (p *PausableObservableImpl) BlockWhilePaused(ctx context.Context)
- func (p *PausableObservableImpl) NotifyObservers(ctx context.Context, e events.Event) error
- func (p *PausableObservableImpl) Pause() error
- func (p *PausableObservableImpl) PauseProcessingOnly() error
- func (p *PausableObservableImpl) Resume() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Observable ¶
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 ¶
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 (*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