How to set background process after logged in as admin (means in admin panel). As I have function which send push notification to 10,000 users so while sending notification my screen is loading till half an hour and I can’t do other task on same window.
So I want to set that process as background so I can do other task. I am using GCM push notification code to send notification.
1) Cron:
Setting up a cron is one way. However, WordPress cron is not that much real time as compared to system based cron.
http://codex.wordpress.org/Function_Reference/wp_cron
http://codex.wordpress.org/Function_Reference/wp_schedule_event
2) AJAX:
You can also process the functionality via AJAX, so that at least you don’t get the page busy.
3) Request in parts:
Instead of sending all the requests at once –
You can send some request once, say 10 among 10000.
Save some value in database (saying, request is completed for these).
Send request for next 10 and continue.
If you mixed up this approach with the AJAX approach, then you will have more optimized result.
4) Third party email service (if have to send email notification):
You can also use a third party service for this e.g. MailChimp. There are plugins available for WordPress for this.