PHP question - background process

  • httpftp21
  • Graduate
  • Graduate
  • httpftp21
  • Posts: 101

Post 3+ Months Ago

I want to do the following Stuff in PHP
Current Process:
When user submits request from Ajax Popup, it is processed by the server and the processed output is send to the user.
The process involves convsersion of client daat to PDF.

Required Process:
Now i want the server process to be done it back ground, a pop willl open up that will track alll the process and show the link to downlaod file when it is completed.
Can we do it in PHP then How? The process will run on Linux and Wwindows machine
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

What are you really trying to ask? I'm not sure whether to answer how to convert data to a PDF format or how to write an ajax request that will send data to the server and wait for a response.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13503
  • Loc: Florida

Post 3+ Months Ago

The first things that come to mind for me are the ignore_user_abort and register_shutdown_function functions. I don't like the idea of having the users controlling the speed at which documents are processed though. It opens me up for denial of service attacks and bogged down performance.

I would rather use something that requested a "ticket" or UUID from the server, then uploaded the data using that ticket, ending that request right there. The data wouldn't be processed immediately though, it would just return a successful upload message and tell the browser it was ok to start sending ajax requests including that ticket requested earlier to see if the document had been processed yet.

Depending on which OS is processing requests, an automated task or a cron job would be used to process the data in batches.

When the AJAX request was made, it would either be answered with a link to download the resulting file, or some statistics about how many files are ahead of them to be processed and an estimated time until comletion based on the batch size and time frame of the cron/AT which will probably be in 60 second intervals.
  • httpftp21
  • Graduate
  • Graduate
  • httpftp21
  • Posts: 101

Post 3+ Months Ago

THx for ur reply
ur statements regarding ignore_user_abort and register_shutdown_function helped me

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 101 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.