Re: Asynchronous PHP Execution
| From: | Waynn Lue | Date: | Sun, 06 Jul 2008 09:12:24 +0000 |
| Subject: | Re: Asynchronous PHP Execution | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-276328@lists.php.net to get a copy of this message | ||
On Sat, Jul 5, 2008 at 12:28 PM, Daniel Brown <parasane@gmail.com> wrote:
> On Sat, Jul 5, 2008 at 6:01 AM, Waynn Lue <waynnlue@gmail.com> wrote:
> > I have a system where a user clicks on a button which causes rows to
> > be inserted in to the database. I'd also like to run some lengthier
> > post-processing on those rows, but don't want to put it in the
> > critical path of the rows being inserted and returning to the user.
> > What's the best way to either batch up these other actions, or pass
> > them to a thread or other asynchronous process to do the second part
> > of the action?
>
> Can you just run this via a cron or Scheduled Task? Just have a
> boolean column that distinguishes new rows as unprocessed, and flip
> the flag when the cron script processes the row.
>
The problem with that is it requires another column to a table, which across
all our databases will take a really long time. The other way is to create
another table, which means we're inserting across multiple tables.
Waynn