Skip to content

Scheduler

Josh Wright edited this page Jan 14, 2021 · 4 revisions

Scheduler

Schedules Jobs at recurring intervals, like a cron.

public struct Scheduler

Usage:

self.scheduler
    .every(1.days.at(hr: 12), run: UpdateQueries())
    .every(1.days.at(hr: 9, min: 27, sec: 43), run: SyncSubscriptions())
    .every(1.minutes.at(sec: 30), run: RunQueries())
    .every(1.minutes, run: CheckAlerts())

Methods

every(_:run:)

Schedules a Job at a recurring interval.

@discardableResult public func every<J: Job>(_ frequency: Frequency, run job: J) -> Scheduler

Parameters

  • frequency: The frequency at which this Job should be run. See Frequency.
  • job: The Job to schedule.

Returns

This Scheduler with which more Jobs can be scheduled.

Alchemy
Types
Protocols
Global Typealiases
Global Variables
Global Functions
Fusion
Types
Protocols
Papyrus
Types
Protocols
Clone this wiki locally