Laravel Queue の運用管理 / laravel-queue-20190318

Laravel Queue の運用管理 / laravel-queue-20190318

6fd2e23d73c26ccbd7df9e3eefacd3ae?s=128

Masato Igarashi

March 18, 2019
Tweet

Transcript

  1. -BSBWFM2VFVFͷӡ༻؅ཧ ޒेཛྷਖ਼ਓגࣜձࣾΦʔϓϯϩδ
 -BSBWFM7VFKTษڧձ

  2. ޒेཛྷਖ਼ਓ!NJHST גࣜձࣾΦʔϓϯϩδ$50 ຊ೔͔࣌Β෋࢜ొࢁڝ૸ΤϯτϦʔ

  3. γϯϓϧͰ࢖͍উखͷྑ͍ ෺ྲྀΞ΢τιʔγϯάϓϥοτϑΥʔϜ ϞϊΛ༬͚ͯൃૹ୅ߦΛ͍ͨ͠ՙओاۀ͞·ͱ ૔ݿɾ഑ૹاۀ͞·Λ Ϋϥ΢υܕͷγεςϜͰͭͳ͍Ͱ͍·͢ɻ Φʔϓϯϩδͱ͸ʁ

  4. ٕज़ελοΫ https://qiita.com/migrs/items/dab171ee613f0c278596 ΦʔϓϯϩδΛࢧ͑Δٕज़ʢ೥൛ʣ

  5. δϣϒͷجຊ ίϚϯυΫΤϦ੹຿෼཭ $PNNBOE2VFSZ3FTQPOTJCJMJUZ4FHSFHBUJPO $234

  6. ಡΈࠐΈ ҰൠతͳॲཧͷྲྀΕ Web Command Write Processed Web Query Read Result

    ॻ͖ࠐΈ DB DB
  7. $234 ͢΂ͯͷॻ͖ࠐΈ͸δϣϒͰߦ͏ Job Web Command Enqueue Accepted Dequeue Write Processed

    Pusher Processed Queue DB
  8. public function updateItem($id, Request $request) { $item = Item::findOrFail($id); $item->name

    = $request->input('name'); $item->save(); } public function updateItem($id, Request $request) { dispatch(new UpdateItem($id, [ 'name' => $request->input('name'); ])); } ίʔυͷมԽ
  9. δϣϒͷεςʔλε؅ཧ -BSBWFM)PSJ[POͱ-BSBWFM5FMFTDPQF ͢΂͕ͯδϣϒͰॲཧ͞Ε͍ͯΔͷͰ ͦΕͳΓʹͪΌΜͱ؅ཧ͍ͨ͠

  10. -BSBWFM)PSJ[PO

  11. -BSBWFM5FMFTDPQF

  12. )PSJ[POͱ5FMFTDPQFͷҧ͍ )PSJ[PO 5FMFTDPQF 4VNNBSZ 3FEJTΩϡʔઐ༻ͷ
 ϞχλϦϯάπʔϧ -BSBWFM಺ͷঢ়ଶΛ೺ѲͰ͖Δ ։ൃ༻σόοάπʔϧ 5BSHFU&OW 1SPEVDUJPO

    %FWFMPQNFOU 7FSTJPO -ʙ -ʙ 2VFVF 3FEJTPOMZ "MM JODMVEF4ZOD 3FUSZ'BJMFE+PC ˓ ☓ 4IPX+PC4UBUVT ˚ 3FDFOUPOMZ ˓
  13. ΦʔϓϯϩδͰ͸ ֤δϣϒͷεςʔλε؅ཧ ୭͕ ͍ͭ Ͳ͜Ͱ ԿΛ ΍ͬͨͷ͔

  14. -BSBWFM5FMFTDPQF

  15. -BSBWFM5FMFTDPQF

  16. ΦʔϓϯϩδͰ͸ 'BJMFE+PCͷ࠶࣮ߦ

  17. -BSBWFM)PSJ[PO

  18. ๻͕ͨͪٻΊͯΔ΋ͷ )PSJ[PO 5FMFTDPQF ཉ͍͠΋ͷ 4VNNBSZ ϞχλϦϯά σόοά ϞχλϦϯά
 ϩΪϯά 5BSHFU&OW

    1SPEVDUJPO %FWFMPQNFOU 1SPEVDUJPO 7FSTJPO -ʙ -ʙ - 2VFVF 3FEJTPOMZ "MM JODMVEF4ZOD "MM 3FUSZ'BJMFE +PC ˓ ☓ ˓ 4IPX+PC 4UBUVT ˚ 3FDFOUPOMZ ˓ ˓
  19. ·ͱΊ ͢΂ͯͷߋ৽ॲཧΛδϣϒͰ࣮૷͢Δ͜ͱͰɾɾɾ ✓εέʔϥϒϧ ✓ؔ৺ࣄͷ෼཭ ✓ͦΕͧΕݸผʹεέʔϦϯάͰ͖Δ δϣϒͷ࣮ߦه࿥Λ࢒͢͜ͱͰɾɾɾ ✓࣮ূՄೳͳ؂ࠪূ੻Λ࢒ͤΔ ✓τϥϒϧγϡʔςΟϯά͠΍͍͢