Webador / SlmQueue

Laminas / Mezzio module that integrates with various queue management systems.
Other
138 stars 57 forks source link

Cleanup servicemanager #241

Closed pimjansen closed 3 years ago

pimjansen commented 3 years ago

Im using SLM queue with some jobs to send email. To do this i inject a mail class into the job. At this point im receiving SMTP timeouts which are caused probably due the fact that the process is using the same mail class from the servicemanager instead of destroying the old one and constructing a new one.

Result is that the connection remains open and at the end throws a timeout error.

Any idea what i can do about this?

roelvanduijnhoven commented 3 years ago

At this point im receiving SMTP timeouts which are caused probably due the fact that the process is using the same mail class from the servicemanager instead of destroying the old one and constructing a new one.

@pimjansen The service manager by default reuses the service. So that is really by intent, and also how all service managers / containers work :).

If you want to connect / disconnect for each mail. You should model this yourself within either your job or your own service (call ->connect, cal ->mail and ->disconnect for example).

Good luck!

pimjansen commented 3 years ago

Thanks @roelvanduijnhoven! Thought that i maybe missed something just like the doctrine unit of work and such.

I will figure something out. Probably a destruct on the job itself