Originally posted by uid313
View Post
When you do not care about the response, then you simply have a 3th party process / server handle the mail sending, while you process the webhook / service bus. If you get a invalid responds from the 3th party process or a failure ( use a cron or whatever to check every X times ), you roll back the webhook / service bus ( checking is something you need to do with a async process anyway in case of a failure ). I see little reason to let PHP handle large mails ( i assume that is your issue ) sending anyway.
Anything that is not 10MB mails will be so fast to handle anyway, that even in synchronous mode ( mail, wait responds, hook / bus ) it does not affect the clients. If your handling 1000]s of mails, that exceed your Ethernet connection, async is not going to help your anyway.
People simply make things out to be more difficult, then what they are. For most people 95% of the code that your write is synchronous anyway and async code complicates things.
If you really want to push async, then use Swoole or any of the dozen PHP based solutions that introduce async responds handling for PHP.
Comment