GS2-JobQueue Transaction Actions

Specification of verify/consume/acquire transaction actions

Consume Action

Gs2JobQueue:DeleteJobByUserId

Delete a job by specifying a user ID

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

Supports quantity specification: NO

Whether the action is reversible: NO

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
Specify #{userId} to substitute the currently logged-in user’s ID.
jobName string
UUID ~ 36 chars Job 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.
timeOffsetToken string ~ 1024 chars Time 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 specifying a 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.

Supports quantity specification: NO

Whether the action is reversible: NO

Type Condition Required Default Value Limits Description
namespaceName string
~ 128 chars Namespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userId string
~ 128 chars User ID
Specify #{userId} to substitute the currently logged-in user’s ID.
jobs List<JobEntry> 0 ~ 10 items List of jobs to add
timeOffsetToken string ~ 1024 chars 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"
    }
}
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",
})