GS2-JobQueue Transaction Actions

Specification of verify/consume/acquire transaction actions

Consume Action

Gs2JobQueue:DeleteJobByUserId

Delete a job by User ID

Deletes a specific job from the specified user’s job queue. The job is removed regardless of its execution state.

Quantity specification supported: NO

Reversible action: NO

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
Specify #{userId} to substitute the currently logged-in user’s ID.
jobNamestring
UUID~ 36 charsJob Name
Maintains a unique name for each job.
The name is automatically generated in UUID (Universally Unique Identifier) format and used to identify each job.
timeOffsetTokenstring~ 1024 charsTime offset token
{
    "action": "Gs2JobQueue:DeleteJobByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "jobName": "[string]Job Name",
        "timeOffsetToken": "[string]Time offset token"
    }
}
action: Gs2JobQueue:DeleteJobByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  jobName: "[string]Job Name"
  timeOffsetToken: "[string]Time offset token"
transaction.service("jobQueue").consume.delete_job_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    jobName="[string]Job Name",
    timeOffsetToken="[string]Time offset token",
})

Acquire Action

Gs2JobQueue:PushByUserId

Register jobs by User ID

Registers one or more jobs to the user’s job queue (up to 10 at a time). Each job specifies a GS2-Script to execute, its arguments, and a maximum retry count. If enableAutoRun is enabled on the Namespace, jobs are executed immediately and asynchronously after registration, and the autoRun flag in the response is set to true. If enableAutoRun is disabled, jobs are queued and must be executed manually via the Run API, with the autoRun flag set to false.

Quantity specification supported: NO

Reversible action: NO

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
Specify #{userId} to substitute the currently logged-in user’s ID.
jobsList<JobEntry>0 ~ 10 itemsList of jobs to add
timeOffsetTokenstring~ 1024 charsTime offset token
{
    "action": "Gs2JobQueue:PushByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "jobs": [
            {
                "scriptId": "[string]Script GRN",
                "args": "[string]Argument",
                "maxTryCount": "[int]Maximum Number of Attempts"
            }
        ],
        "timeOffsetToken": "[string]Time offset token"
    }
}
action: Gs2JobQueue:PushByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  jobs: 
    - scriptId: "[string]Script GRN"
      args: "[string]Argument"
      maxTryCount: "[int]Maximum Number of Attempts"
  timeOffsetToken: "[string]Time offset token"
transaction.service("jobQueue").acquire.push_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    jobs={
        {
            scriptId="[string]Script GRN",
            args="[string]Argument",
            maxTryCount="[int]Maximum Number of Attempts"
        }
    },
    timeOffsetToken="[string]Time offset token",
})