Synchronous vs asynchronous is a choice for the author of the my_operatornotify file. This module just hands the subject + body to your code.
I did some experimenting with async sending and even batching in mine, but decided to remove that and stick with synchronous. The SMTP connection is really fast and most programs send the email at the end of runtime, so it doesn't matter anyway. I prefer the simplicity. I certainly did not want to get into managing an outbound spool, waiting for the server to come back, running a separate daemon for this...
In my_operatornotify I use tenacity to do a couple of retries, then write the message and the fatal exception to a txt file on my desktop or ~/ if there is an error sending the email. I'll notice it eventually. The stuff I'm doing is not important enough to demand more retrying.
voussoir|4 years ago
I did some experimenting with async sending and even batching in mine, but decided to remove that and stick with synchronous. The SMTP connection is really fast and most programs send the email at the end of runtime, so it doesn't matter anyway. I prefer the simplicity. I certainly did not want to get into managing an outbound spool, waiting for the server to come back, running a separate daemon for this...
In my_operatornotify I use tenacity to do a couple of retries, then write the message and the fatal exception to a txt file on my desktop or ~/ if there is an error sending the email. I'll notice it eventually. The stuff I'm doing is not important enough to demand more retrying.
Thanks for reading!