Documentation
¶
Overview ¶
Package schedule contains the RRULE schedule trigger node.
Index ¶
Constants ¶
const PayloadTypeTimestamp = "timestamp"
PayloadTypeTimestamp is the schedule-specific timestamp spelling.
const Type = "schedule"
Type is the schedule node's palette/deploy type.
Variables ¶
This section is empty.
Functions ¶
func Descriptor ¶
func Descriptor() nodebase.NodeDescriptor
Descriptor returns the schedule node's palette metadata and schema.
func EditorHTML ¶
func EditorHTML() string
EditorHTML returns the embedded editor markup and help text.
Types ¶
type ScheduleConfig ¶
type ScheduleConfig struct {
// RRule is an RFC 5545 recurrence rule. Accepted forms are a bare
// FREQ rule, an RRULE:-prefixed rule, or DTSTART/RRULE on two lines.
RRule string `json:"rrule"`
// Timezone is empty for server-local time or an IANA timezone name.
Timezone string `json:"timezone"`
// PayloadType is timestamp, date, json, string, number, boolean, or
// environment. Empty defaults to date.
PayloadType string `json:"payloadType"`
// Payload is interpreted according to PayloadType on every fire.
Payload string `json:"payload"`
// Topic is copied into message metadata on every fire.
Topic string `json:"topic"`
}
ScheduleConfig holds the schedule node's durable configuration.
type ScheduleNode ¶
ScheduleNode is a trigger that arms exactly one in-memory timer for the next RRULE occurrence, emits, then re-arms. Per-run state lives in the host's node-state slot because executors may be rebuilt between deliveries: a rebuilt executor sees started=true and does not double-arm.
func NewScheduleNode ¶
func NewScheduleNode(node nodestore.NodeInterface, config *ScheduleConfig, host nodebase.NodeHost) *ScheduleNode
NewScheduleNode creates a schedule node executor.
func (*ScheduleNode) Activate ¶
func (n *ScheduleNode) Activate(ctx context.Context) error
Activate validates the recurrence and arms the first occurrence. It is idempotent for the lifetime of the workflow run through the host's per-node state slot.
func (*ScheduleNode) Execute ¶
func (n *ScheduleNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute is intentionally inert-invalid: schedule is a source trigger and does not process wired input. Deployment calls Activate instead.
func (*ScheduleNode) Stop ¶
func (n *ScheduleNode) Stop() error
Stop cancels the pending timer. It is idempotent and never resolves the host state slot: the engine may hold its run lock while stopping nodes, so activation caches the state pointer on this executor shell instead.
func (*ScheduleNode) StopKey ¶
func (n *ScheduleNode) StopKey() string
StopKey deduplicates rebuilt executors in the runner's stopper registry.
func (*ScheduleNode) Validate ¶
func (n *ScheduleNode) Validate() error
Validate checks deploy-time configuration. Invalid RRULEs and timezones are deploy errors, while valid exhausted/future rules are accepted and remain dormant.