triggers

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 15 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMercuryRemoteAggregator

func NewMercuryRemoteAggregator(codec datastreams.ReportCodec, allowedSigners [][]byte, minRequiredSignatures int, lggr logger.Logger) *mercuryRemoteAggregator

This aggregator is used by TriggerSubscriber to aggregate trigger events from multiple remote nodes. NOTE: Once Mercury supports parallel composition (and thus guarantee identical sets of reports), this will be replaced by the default MODE aggregator.

Types

type MercuryTriggerService

type MercuryTriggerService struct {
	capabilities.CapabilityInfo
	// contains filtered or unexported fields
}

This Trigger Service allows for the registration and deregistration of triggers. You can also send reports to the service.

func NewMercuryTriggerService

func NewMercuryTriggerService(tickerResolutionMs int64, lggr logger.Logger) *MercuryTriggerService

Mercury Trigger will send events to each subscriber every MaxFrequencyMs (configurable per subscriber). Event generation happens whenever local unix time is a multiple of tickerResolutionMs. Therefore, all subscribers' MaxFrequencyMs values need to be a multiple of tickerResolutionMs.

func (*MercuryTriggerService) Close

func (o *MercuryTriggerService) Close() error

func (*MercuryTriggerService) HealthReport

func (o *MercuryTriggerService) HealthReport() map[string]error

func (*MercuryTriggerService) Name

func (o *MercuryTriggerService) Name() string

func (*MercuryTriggerService) ProcessReport

func (o *MercuryTriggerService) ProcessReport(reports []datastreams.FeedReport) error

func (*MercuryTriggerService) Ready

func (o *MercuryTriggerService) Ready() error

func (*MercuryTriggerService) RegisterTrigger

func (*MercuryTriggerService) SetMetaOverride

func (o *MercuryTriggerService) SetMetaOverride(meta datastreams.Metadata)

func (*MercuryTriggerService) Start

func (*MercuryTriggerService) UnregisterTrigger

func (*MercuryTriggerService) ValidateConfig

func (o *MercuryTriggerService) ValidateConfig(config *values.Map) (*streams.TriggerConfig, error)

type OnDemand

type OnDemand struct {
	capabilities.Validator[onDemandTriggerConfig, any, capabilities.TriggerResponse]
	capabilities.CapabilityInfo
	// contains filtered or unexported fields
}

func NewOnDemand

func NewOnDemand(log logger.Logger) *OnDemand

NewOnDemand creates a new on-demand trigger. The sendChannelBufferSize should be sized to ensure each client has sufficient time to process events, once this buffer is full new events for the client will be dropped.

func (*OnDemand) FanOutEvent

func (o *OnDemand) FanOutEvent(ctx context.Context, response capabilities.TriggerResponse) error

func (*OnDemand) RegisterTrigger

func (*OnDemand) SendEvent

func (o *OnDemand) SendEvent(ctx context.Context, wid string, event capabilities.TriggerResponse) error

SendEvent sends an event to a specific workflowId. If the workflowId is not registered an error is returned.

func (*OnDemand) UnregisterTrigger

func (o *OnDemand) UnregisterTrigger(ctx context.Context, req capabilities.TriggerRegistrationRequest) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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