Claudio Dekker
banner
claudiodekker.me
Claudio Dekker
@claudiodekker.me
Artisan at @laravelphp ❯ Open-source enthusiast ❯ GPG 08FD B44B 6D63 2021 5D1E E8C1 3025 FFE2 33CC C24B
Yep, agreed!
December 22, 2024 at 8:17 AM
Of course, these are just the fundamentals, and with Laravel, there's way more you can do to multiply your power level, such as the scheduling of periodic tasks (e.g. statistics calculations/updates) that you can store/keep warm in the cache, but the opportunities are endless! 👍
December 21, 2024 at 8:37 AM
Now, technically there is one other benefit to queueing; Imagine spills your coffee mid-prep. ☕

- ✅ With a queue: They’ve got your order ticket and just start over.
- ❌ Without a queue: You awkwardly re-explain your triple-shot, half-decaf, oat milk latte.
December 21, 2024 at 8:37 AM
For example, imagine you're ordering a coffee at a busy cafe:

- ✅ With queues, you'd get a buzzer and can sit down and relax until your coffee is ready
- ❌ Without queues, you're awkwardly standing at the counter until it's ready

In both cases, the barista' work just as hard
December 21, 2024 at 8:37 AM
In most cases, I'd recommend #2 even if you need a response right now.

Why? It's simple; For the most part, "right now" is a concept that mostly applies to humans, less so to computers.

While "queueing" sounds slow and negative (nobody likes queues), they're definitely not.
December 21, 2024 at 8:37 AM
You might ask; but what about things that need a response _right now_? And to that I'd say you have two approaches:

1. Lie about it succeeding (e.g. "an email has been sent")
2. Add a "processing" state, and use polling/websockets to get an update the second something's done.
December 21, 2024 at 8:37 AM
Examples of things you'd queue:

- ✅ Sending an email
- ✅ Calling a third-party API to send/fetch data
- ✅ Resizing an uploaded image
- ✅ Processing a payment or order
- ✅ Handling an incoming webhook
December 21, 2024 at 8:37 AM
Yeah, I think the PHP 8.0 Attributes are a syntaxical crime against developers.

It's like that one ex I regret but can't seem to escape.
November 21, 2024 at 1:22 PM
Phew, at least it ain’t me this time
October 21, 2023 at 3:40 PM
Of course! 👋
October 14, 2023 at 11:32 AM
Sous vide is the best
October 2, 2023 at 7:33 AM