Re:Your DI framework is killing your code
by to3m on Tuesday September 29, 2015 @09:02AM
(#10295904)
"GetMailPolicySingleton()->SetSendingMechanism(Email::SMTP)" ;)
[ Parent
| on HN ]
Re:Your DI framework is killing your code
by rescripting on Tuesday September 29, 2015 @09:54AM
(#10296270)
Sometimes you're sending via SMTP, sometimes via MailGun. If you don't remember to call GetMailPolicySingleton()->SetSendingMechanism() before every email.send() you end up using whatever policy was set last.
Re:Your DI framework is killing your code
by taspeotis on Tuesday September 29, 2015 @10:18AM
(#10296440)
> Singleton
What if two threads need to send mail via SMTP and Mailgun...
Re:Your DI framework is killing your code
by anton_gogolev on Tuesday September 29, 2015 @10:29AM
(#10296511)
Singletons have nothing to do with reentrancy or lack thereof.