scheduler

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package scheduler (piece ⑪) is Exhale's clock. It plans reminders, sleeps until the next one is due and delivers it, with retries and catch-up after downtime. No cron: the next wake-up comes from the outbox itself (ADR 0003).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deliverer

type Deliverer interface {
	Deliver(ctx context.Context, item app.OutboxItem) error
}

Deliverer sends one outbox item (the action layer implements it).

type Scheduler

type Scheduler struct {

	// MaxSleep bounds every sleep so that clock jumps and new days are noticed.
	MaxSleep time.Duration
	// contains filtered or unexported fields
}

Scheduler is a supervised service.

func New

func New(svc *app.Service, log *slog.Logger, deliver Deliverer) *Scheduler

New returns a scheduler. deliver may be nil (reminders are planned but not sent, e.g. when no channel is configured).

func (*Scheduler) Serve

func (s *Scheduler) Serve(ctx context.Context) error

Serve runs until ctx is cancelled.

func (*Scheduler) String

func (s *Scheduler) String() string

func (*Scheduler) Tick

func (s *Scheduler) Tick(ctx context.Context)

Tick delivers every due outbox item once.

Jump to

Keyboard shortcuts

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