How to build a distributed queue in a single JSON file on object storage

Simplest idea wins. A fantastic crash course of how a single JSON file laying around somewhere in an S3 bucket can be a full-fledged distributed queue with optimistic locking on top.