Table of Contents

Class ScheduleSpec

Namespace
Temporalio.Api.Schedule.V1
Assembly
Temporalio.dll

ScheduleSpec is a complete description of a set of absolute timestamps (possibly infinite) that an action should occur at. The meaning of a ScheduleSpec depends only on its contents and never changes, except that the definition of a time zone can change over time (most commonly, when daylight saving time policy changes for an area). To create a totally self-contained ScheduleSpec, use UTC or include timezone_data.

For input, you can provide zero or more of: structured_calendar, calendar, cron_string, interval, and exclude_structured_calendar, and all of them will be used (the schedule will take action at the union of all of their times, minus the ones that match exclude_structured_calendar).

On input, calendar and cron_string fields will be compiled into structured_calendar (and maybe interval and timezone_name), so if you Describe a schedule, you'll see only structured_calendar, interval, etc.

If a spec has no matching times after the current time, then the schedule will be subject to automatic deletion (after several days).

public sealed class ScheduleSpec : IMessage<ScheduleSpec>, IEquatable<ScheduleSpec>, IDeepCloneable<ScheduleSpec>, IBufferMessage, IMessage
Inheritance
ScheduleSpec
Implements
IMessage<ScheduleSpec>
IDeepCloneable<ScheduleSpec>
IBufferMessage
IMessage
Inherited Members

Constructors

ScheduleSpec()

public ScheduleSpec()

ScheduleSpec(ScheduleSpec)

public ScheduleSpec(ScheduleSpec other)

Parameters

other ScheduleSpec

Fields

CalendarFieldNumber

Field number for the "calendar" field.

public const int CalendarFieldNumber = 1

Field Value

int

CronStringFieldNumber

Field number for the "cron_string" field.

public const int CronStringFieldNumber = 8

Field Value

int

EndTimeFieldNumber

Field number for the "end_time" field.

public const int EndTimeFieldNumber = 5

Field Value

int

ExcludeCalendarFieldNumber

Field number for the "exclude_calendar" field.

public const int ExcludeCalendarFieldNumber = 3

Field Value

int

ExcludeStructuredCalendarFieldNumber

Field number for the "exclude_structured_calendar" field.

public const int ExcludeStructuredCalendarFieldNumber = 9

Field Value

int

IntervalFieldNumber

Field number for the "interval" field.

public const int IntervalFieldNumber = 2

Field Value

int

JitterFieldNumber

Field number for the "jitter" field.

public const int JitterFieldNumber = 6

Field Value

int

StartTimeFieldNumber

Field number for the "start_time" field.

public const int StartTimeFieldNumber = 4

Field Value

int

StructuredCalendarFieldNumber

Field number for the "structured_calendar" field.

public const int StructuredCalendarFieldNumber = 7

Field Value

int

TimezoneDataFieldNumber

Field number for the "timezone_data" field.

public const int TimezoneDataFieldNumber = 11

Field Value

int

TimezoneNameFieldNumber

Field number for the "timezone_name" field.

public const int TimezoneNameFieldNumber = 10

Field Value

int

Properties

Calendar

Calendar-based specifications of times.

public RepeatedField<CalendarSpec> Calendar { get; }

Property Value

RepeatedField<CalendarSpec>

CronString

cron_string holds a traditional cron specification as a string. It accepts 5, 6, or 7 fields, separated by spaces, and interprets them the same way as CalendarSpec. 5 fields: minute, hour, day_of_month, month, day_of_week 6 fields: minute, hour, day_of_month, month, day_of_week, year 7 fields: second, minute, hour, day_of_month, month, day_of_week, year If year is not given, it defaults to *. If second is not given, it defaults to 0. Shorthands @yearly, @monthly, @weekly, @daily, and @hourly are also accepted instead of the 5-7 time fields. Optionally, the string can be preceded by CRON_TZ=<timezone name> or TZ=<timezone name>, which will get copied to timezone_name. (There must not also be a timezone_name present.) Optionally "#" followed by a comment can appear at the end of the string. Note that the special case that some cron implementations have for treating day_of_month and day_of_week as "or" instead of "and" when both are set is not implemented. @every <interval>[/<phase>] is accepted and gets compiled into an IntervalSpec instead. <interval> and <phase> should be a decimal integer with a unit suffix s, m, h, or d.

public RepeatedField<string> CronString { get; }

Property Value

RepeatedField<string>

Descriptor

public static MessageDescriptor Descriptor { get; }

Property Value

MessageDescriptor

EndTime

If end_time is set, any timestamps after end_time will be skipped.

public Timestamp EndTime { get; set; }

Property Value

Timestamp

ExcludeCalendar

Any timestamps matching any of exclude_* will be skipped.

[Obsolete]
public RepeatedField<CalendarSpec> ExcludeCalendar { get; }

Property Value

RepeatedField<CalendarSpec>

ExcludeStructuredCalendar

public RepeatedField<StructuredCalendarSpec> ExcludeStructuredCalendar { get; }

Property Value

RepeatedField<StructuredCalendarSpec>

Interval

Interval-based specifications of times.

public RepeatedField<IntervalSpec> Interval { get; }

Property Value

RepeatedField<IntervalSpec>

Jitter

All timestamps will be incremented by a random value from 0 to this amount of jitter. Default: 0

public Duration Jitter { get; set; }

Property Value

Duration

Parser

public static MessageParser<ScheduleSpec> Parser { get; }

Property Value

MessageParser<ScheduleSpec>

StartTime

If start_time is set, any timestamps before start_time will be skipped. (Together, start_time and end_time make an inclusive interval.)

public Timestamp StartTime { get; set; }

Property Value

Timestamp

StructuredCalendar

Calendar-based specifications of times.

public RepeatedField<StructuredCalendarSpec> StructuredCalendar { get; }

Property Value

RepeatedField<StructuredCalendarSpec>

TimezoneData

public ByteString TimezoneData { get; set; }

Property Value

ByteString

TimezoneName

Time zone to interpret all calendar-based specs in.

If unset, defaults to UTC. We recommend using UTC for your application if at all possible, to avoid various surprising properties of time zones.

Time zones may be provided by name, corresponding to names in the IANA time zone database (see https://www.iana.org/time-zones). The definition will be loaded by the Temporal server from the environment it runs in.

If your application requires more control over the time zone definition used, it may pass in a complete definition in the form of a TZif file from the time zone database. If present, this will be used instead of loading anything from the environment. You are then responsible for updating timezone_data when the definition changes.

Calendar spec matching is based on literal matching of the clock time with no special handling of DST: if you write a calendar spec that fires at 2:30am and specify a time zone that follows DST, that action will not be triggered on the day that has no 2:30am. Similarly, an action that fires at 1:30am will be triggered twice on the day that has two 1:30s.

Also note that no actions are taken on leap-seconds (e.g. 23:59:60 UTC).

public string TimezoneName { get; set; }

Property Value

string

Methods

CalculateSize()

Calculates the size of this message in Protocol Buffer wire format, in bytes.

public int CalculateSize()

Returns

int

The number of bytes required to write this message to a coded output stream.

Clone()

Creates a deep clone of this object.

public ScheduleSpec Clone()

Returns

ScheduleSpec

A deep clone of this object.

Equals(object)

Determines whether the specified object is equal to the current object.

public override bool Equals(object other)

Parameters

other object

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

Equals(ScheduleSpec)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ScheduleSpec other)

Parameters

other ScheduleSpec

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

MergeFrom(CodedInputStream)

Merges the data from the specified coded input stream with the current message.

public void MergeFrom(CodedInputStream input)

Parameters

input CodedInputStream

Remarks

See the user guide for precise merge semantics.

MergeFrom(ScheduleSpec)

Merges the given message into this one.

public void MergeFrom(ScheduleSpec other)

Parameters

other ScheduleSpec

Remarks

See the user guide for precise merge semantics.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

WriteTo(CodedOutputStream)

Writes the data to the given coded output stream.

public void WriteTo(CodedOutputStream output)

Parameters

output CodedOutputStream

Coded output stream to write the data to. Must not be null.