Job A Job C Job B Job A Job B Job C Consumer 1 Consumer 2 Dequeue Producer 1 Producer 2 Producer 3 Job A Job C Job B Job A Job B Job C Consumer 1 Consumer 2 Dequeue Job A Job AはConsumer 1に 渡されたので一定時間 他のConsumerには視えない Queue Queue Consumer 1が失敗しても Lease失効後、別の ConsumerがDequeueできる
a job Account DB Job X - Incr Account A by $50 Worker 2 Account A: $200 00:01:30 No Jobs Dequeue a job Account A: $250 Job X が一度のみ 実行されたので 期待通り $250 Job X - Account A に $50 追加 - Owner は Worker 1 - Leaseは 00:01:30 に失効 Job X - Account A に $50 追加 - Leaseは 00:01:30 に失効 Increment Account A by $50 Finish Job X No available job Account A: $250
a job Account DB Job X - Incr Account A by $50 Worker 2 Account A: $200 00:01:30 No Jobs Dequeue a job Account A: $250 Job X が一度のみ 実行されたので 期待通り $250 Job X - Account A に $50 追加 - Owner は Worker 1 - Leaseは 00:01:30 に失効 Job X - Account A に $50 追加 - Leaseは 00:01:30 に失効 Increment Account A by $50 Finish Job X No available job Account A: $250
a job Account DB Job X - Incr Account A by $50 Worker 2 Account A: $200 00:01:30 No Jobs Dequeue a job Account A: $250 Job X が一度のみ 実行されたので 期待通り $250 Job X - Account A に $50 追加 - Owner は Worker 1 - Leaseは 00:01:30 に失効 Job X - Account A に $50 追加 - Leaseは 00:01:30 に失効 Increment Account A by $50 Finish Job X No available job Account A: $250
a job Account DB Job X - Incr Account A by $50 Worker 2 Account A: $200 00:01:30 No Jobs Dequeue a job Account A: $250 Job X が一度のみ 実行されたので 期待通り $250 Job X - Account A に $50 追加 - Owner は Worker 1 - Leaseは 00:01:30 に失効 Job X - Account A に $50 追加 - Leaseは 00:01:30 に失効 Increment Account A by $50 Finish Job X No available job Account A: $250