0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

キュー、ワーカー、ジョブとは

Last updated at Posted at 2023-06-28

イメージ

イメージはこんなかんじ

キューという名の筒がある

       queue
      -------------------------

      -------------------------

キューにジョブを入れる

       queue
      -------------------------
-> job
      -------------------------
       queue
      -------------------------
                 job
      -------------------------

ワーカーがキューからジョブを取り出す

       queue                      worker
      -------------------------
                             job ->
      -------------------------

なんのためにキューを使うかというと、非同期に処理を行うため。

       queue
      -------------------------
-> job1
      -------------------------
       queue
      -------------------------
->  job3    job2   job1
      -------------------------

キューに入れておけば、後はワーカーが取り出したジョブを適宜処理する

       queue                      worker
      -------------------------
         job3   job2       job1 ->
      -------------------------

まとめ

  • キュー:非同期処理を行うための待ち行列
  • ジョブ:実行したい処理
  • ワーカー:ジョブを取り出す役割
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?