Class: Priority
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:
- First, consider "priority_key": lower number goes first. (more will be added here later)
Implements
Constructors
constructor
• new Priority(properties?
): Priority
Constructs a new Priority.
Parameters
Name | Type | Description |
---|---|---|
properties? | IPriority | Properties to set |
Returns
Properties
priorityKey
• priorityKey: number
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.
Implementation of
Methods
toJSON
▸ toJSON(): Object
Converts this Priority to JSON.
Returns
Object
JSON object
create
▸ create(properties?
): Priority
Creates a new Priority instance using the specified properties.
Parameters
Name | Type | Description |
---|---|---|
properties? | IPriority | Properties to set |
Returns
Priority instance
decode
▸ decode(reader
, length?
): Priority
Decodes a Priority message from the specified reader or buffer.
Parameters
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |
Returns
Priority
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited
▸ decodeDelimited(reader
): Priority
Decodes a Priority message from the specified reader or buffer, length delimited.
Parameters
Name | Type | Description |
---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
Priority
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
encode
▸ encode(message
, writer?
): Writer
Encodes the specified Priority message. Does not implicitly temporal.api.common.v1.Priority.verify|verify messages.
Parameters
Name | Type | Description |
---|---|---|
message | IPriority | Priority message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
encodeDelimited
▸ encodeDelimited(message
, writer?
): Writer
Encodes the specified Priority message, length delimited. Does not implicitly temporal.api.common.v1.Priority.verify|verify messages.
Parameters
Name | Type | Description |
---|---|---|
message | IPriority | Priority message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
fromObject
▸ fromObject(object
): Priority
Creates a Priority message from a plain object. Also converts values to their respective internal types.
Parameters
Name | Type | Description |
---|---|---|
object | Object | Plain object |
Returns
Priority
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?
): string
Gets the default type url for Priority
Parameters
Name | Type | Description |
---|---|---|
typeUrlPrefix? | string | your custom typeUrlPrefix(default "type.googleapis.com") |
Returns
string
The default type url
toObject
▸ toObject(message
, options?
): Object
Creates a plain object from a Priority message. Also converts values to other types if specified.
Parameters
Name | Type | Description |
---|---|---|
message | Priority | Priority |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object