Welcome Guest, Not a member yet? Register   Sign In
action send response immediatelyl then do other task
#1

[eluser]Unknown[/eluser]
I would like my controller action to immediately send a 200 response to the user and then do some more activity. This will improve the user experience as the user will not need to wait for longer tasks to complete and I will eventually notify the user the tasks are complete by email.

Is there a particularly CodeIgniter friendly way of doing this?

Thanks,
Peter
#2

[eluser]mackski[/eluser]
I presume you're talking about running a long background process, whilst giving the user some indication that this is happening.

http://stackoverflow.com/questions/45953...nd-process
#3

[eluser]CroNiX[/eluser]
I use a fsocket call to a url to trigger a background process, which the user doesn't have to wait for. After filling out a form, they get immediate feedback and can continue on while other things are going on in the background.

Something like this:
http://blog.markturansky.com/archives/205




Theme © iAndrew 2016 - Forum software by © MyBB