Hi, I'm Uttkarsh , a tech enthusiast with a knack for building cool stuff. I enjoy translating ideas into code, whether it's crafting user interfaces or tackling new challenges. There's a certain satisfaction in creating things. I'm here to keep learning, coding, and having fun along the way. When not coding, you'll find me exploring different interests and trying to make the most out of every moment. Open to collaborations and always up for a tech chat. Feel free to connect!
Markdown supported · ⌘↵ to post
Uttkarsh
Hayrullah Kar
Acknowledging quickly with 202 and doing the work in the background is the right instinct, and the restaurant analogy makes the timing easy to follow. I would add two things before readers copy the pattern to production. First, the 202 is a promise. Once the sender sees a 2xx, it treats the event as delivered and will not retry it. If the job only lives in a goroutine or an in-memory channel and the process restarts, that payment event is gone. Writing the payload to durable storage, such as a table or a queue, before returning 202 closes that gap. Second, senders such as Stripe retry deliveries that time out or fail, so the same event can arrive more than once. Storing the event ID under a unique constraint stops a payment from being processed twice. It may also help to say that the callback to the sender's status endpoint is specific to this demo. Stripe and GitHub only expect the 2xx and do not offer an endpoint for that confirmation. Verifying the HMAC signature header would make a natural next version.