Documentation
¶
Index ¶
- func Register(ctx context.Context, db *pgxpool.Pool, workerID, region string, ...)
- type CloudJobSource
- func (s *CloudJobSource) Ack(ctx context.Context, lease spec.Lease, result spec.CheckResult) error
- func (s *CloudJobSource) Heartbeat(ctx context.Context, lease spec.Lease) error
- func (s *CloudJobSource) Nack(ctx context.Context, lease spec.Lease, reason string) error
- func (s *CloudJobSource) Poll(ctx context.Context, _ spec.WorkerInfo) ([]spec.Lease, error)
- type Pool
- type ResultHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CloudJobSource ¶
type CloudJobSource struct {
// contains filtered or unexported fields
}
CloudJobSource implements spec.JobSource against the platform Postgres DB. Workers claim Monitor rows using SELECT … FOR UPDATE SKIP LOCKED.
func NewCloudJobSource ¶
func (*CloudJobSource) Ack ¶
func (s *CloudJobSource) Ack(ctx context.Context, lease spec.Lease, result spec.CheckResult) error
Ack commits a completed check: writes the result, updates Monitor status, advances nextCheckAt, clears the lease, and dispatches alerts on transitions.
func (*CloudJobSource) Heartbeat ¶
Heartbeat extends the lease expiry to prevent expiration during long-running checks.
func (*CloudJobSource) Poll ¶
func (s *CloudJobSource) Poll(ctx context.Context, _ spec.WorkerInfo) ([]spec.Lease, error)
Poll claims up to batchSize due monitors and returns them as Leases.
type ResultHandler ¶
type ResultHandler func(spec.CheckResult)
Click to show internal directories.
Click to hide internal directories.