Question

I am developing a system with Symfony which has a notification module integrated into it. The purpose of the script is to allow for a wide range of compatibility, and as such the requirements would leave cron, root & shell out of the question.

Currently, the system sends notifications when specific actions are executed. For example, making a post, uploading a file, changing a status, ect. The problem with this approach is that it can cause certain actions to be very slow if there is a substantial number of users with notification subscriptions.

My question is - are there any solutions that would allow me to queue and defer this notification task until after the action has been executed? Thereby eliminated any lag connected to large email tasks.

Thanks in advance for your help - much appreciated!

Was it helpful?

Solution

As I recall, WordPress solves this issue by passing some javascript code to the client that with make an AJAX call to the server to execute the long running process. The AJAX call is asynchronous so it is non-blocking and doesn't affect page load times.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top