本ブログはLayerX Tech Advent Calendar 2022 の 12/13 の記事です。 こんにちは、バクラクのOCRなどを開発しているTomoakiです。 コーヒーはラテよりカプチーノ派です。 Machineryとは MachineryはGo製の非同期タスク管理フレームワークです。 github.com バクラクのバックエンドでは主にGo言語を採用しており、非同期で実行したい処理はメッセージキューとしてAmazon SQS、メッセージの送受信やジョブワーカーの管理にはMachinery(v1)を使用しています。 OCRでも採用している技術スタックは同じで、突然大量のリクエストが来ても対応できるように非同期処理を多用しております。 以下の図のようにファイルがアップロードされてから、OCRの実行結果を返すまでの過程で非同期処理がたくさん実行されています。 OCRの非同期タスク