Performance: Queue producers
MEDIUM IMPACT
This affects how fast messages are sent to the queue and how it impacts server responsiveness and resource usage.
sendMessage(data) {
this.queueClient.send(data).subscribe();
// fire-and-forget, non-blocking
}async sendMessage(data) { await this.queueClient.send(data).toPromise(); // waits for confirmation before continuing }
| Pattern | Event Loop Blocking | Throughput | Resource Usage | Verdict |
|---|---|---|---|---|
| Synchronous await per message | High (blocks event loop) | Low (sequential) | Moderate | [X] Bad |
| Fire-and-forget async send | Low (non-blocking) | High (parallel) | Low | [OK] Good |