Table of Contents

Class Priority

Namespace
Temporalio.Api.Common.V1
Assembly
Temporalio.dll

Priority contains metadata that controls relative ordering of task processing when tasks are backlogged in a queue. Initially, Priority will be used in activity and workflow task queues, which are typically where backlogs exist. Other queues in the server (such as transfer and timer queues) and rate limiting decisions do not use Priority, but may in the future.

Priority is attached to workflows and activities. Activities and child workflows inherit Priority from the workflow that created them, but may override fields when they are started or modified. For each field of a Priority on an activity/workflow, not present or equal to zero/empty string means to inherit the value from the calling workflow, or if there is no calling workflow, then use the default (documented below).

Despite being named "Priority", this message will also contains fields that control "fairness" mechanisms.

The overall semantics of Priority are:

  1. First, consider "priority_key": lower number goes first. (more will be added here later)
public sealed class Priority : IMessage<Priority>, IEquatable<Priority>, IDeepCloneable<Priority>, IBufferMessage, IMessage
Inheritance
Priority
Implements
IMessage<Priority>
IDeepCloneable<Priority>
IBufferMessage
IMessage
Inherited Members

Constructors

Priority()

public Priority()

Priority(Priority)

public Priority(Priority other)

Parameters

other Priority

Fields

PriorityKeyFieldNumber

Field number for the "priority_key" field.

public const int PriorityKeyFieldNumber = 1

Field Value

int

Properties

Descriptor

public static MessageDescriptor Descriptor { get; }

Property Value

MessageDescriptor

Parser

public static MessageParser<Priority> Parser { get; }

Property Value

MessageParser<Priority>

PriorityKey

Priority key is a positive integer from 1 to n, where smaller integers correspond to higher priorities (tasks run sooner). In general, tasks in a queue should be processed in close to priority order, although small deviations are possible.

The maximum priority value (minimum priority) is determined by server configuration, and defaults to 5.

The default priority is (min+max)/2. With the default max of 5 and min of 1, that comes out to 3.

public int PriorityKey { get; set; }

Property Value

int

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 Priority Clone()

Returns

Priority

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(Priority)

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

public bool Equals(Priority other)

Parameters

other Priority

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(Priority)

Merges the given message into this one.

public void MergeFrom(Priority other)

Parameters

other Priority

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.