designation: | D1-005 |
---|---|
author: | andrew white |
status: | in progress |
prepared date: | October 31, 2024 |
updated date: | October 31, 2024 |
Abstract: I wanted to make a scheduler for asynchronous, distributed, conversations. But it ended up being twitter or something.
This is meant for a coherent conversation with hundreds to thousands of participants. It works on a bidding principle, where to post a message you must bid. A new message will post every 60 seconds, and you will be bidding on the next message.
In each minute, the highest bidder's message gets posted, but they only pay the second-highest bid amount (Vickrey auction principle). Losing bidders get a small balance increase as compensation.
API Overview:
API_URL=https://msgbid-worker.andrew-88e.workers.dev
curl -X PUT ${API_URL}/register \
-H "Content-Type: application/json" \
-d '{"name": "Alice"}'
Response: Returns a token and initial balance
curl -X POST ${API_URL}/messages \
-H "Content-Type: application/json" \
-H "X-Client-Token: your_token" \
-d '{"message": "Hello world!", "bid": 10}'
Response: Returns message status (accepted/rejected), new balance, and auction stats
curl ${API_URL}/messages?limit=10