> For the complete documentation index, see [llms.txt](/llms.txt)

# GS2-JobQueue API Reference

Asynchronous job queue




This service provides a job queue function.

A job queue is a queue with a guaranteed FIFO and can be used for eventual consistency.
Eventual consistency is a mechanism in which processing is not guaranteed to be complete when the API responds, but "results in the intended state" after a certain amount of time has elapsed.

GS2 processes many aspects of reward distribution using eventual consistency.
This is to avoid the possibility of various services becoming unavailable in the same way as if the server that manages the rewards were down when the rewards are granted.
By registering reward granting processes in the job queue, eventual consistency is achieved through job retries, even if the target service is unavailable when the job is executed.
The maximum number of retries can be specified, and if the maximum number is reached and the job does not succeed, it is stored in a model that accumulates failed jobs called dead letter jobs.
The dead letter jobs can be used to provide individualized handling of jobs that have failed.

When the namespace's `enableAutoRun` is disabled (the default), jobs are not executed automatically; you must explicitly call the execution API.
When `enableAutoRun` is enabled, registered jobs execute automatically on the server. The following client execution pattern applies to manual mode.
This allows the client to obtain the return values of jobs.
For example, after completing a quest in GS2-Quest, a job to grant rewards is registered in the job queue.
The client can explicitly execute the reward granting process obtained from the quest by running the job queue to completion.
(This makes it possible to wait for the completion of delayed processing based on eventual consistency.)
In addition, by referencing the return values of the job, the client can reflect the obtained rewards in the UI.

A job can only be registered and executed up to 3 times per second.

[Introduction to Microservices / GS2-JobQueue](../../microservices/job_queue)



- [GS2-JobQueue Deploy/CDK Reference](/api_reference/job_queue/deploy/)
  
- [GS2-JobQueue SDK API Reference](/api_reference/job_queue/sdk/)
  
- [GS2-JobQueue SDK for Game Engine API Reference](/api_reference/job_queue/game_engine/)
  
- [GS2-JobQueue Transaction Actions](/api_reference/job_queue/stamp_sheet/)
  
