Multithreading in PHP

I am working on windows. I created a twitter app using the twitter API that checks for new tweets periodically and also allows users to update their status. I wrote separate PHP files for reading (reader.php) and tweets (writer.php). The only problem is how I tweet periodically. There are several ways I can think of -

1) Use a time based job scheduler (like Cron) to run reader.php periodically. How to do it?

2) Use multithreading to run both reader and writer.php and use timer function in reader.php

Suggestions?

+2


a source to share


2 answers


Since you are on Windows, you probably won't be able to use easily cron

. However, you can use the task scheduler. See this link for step by step instructions.



+3


a source


Another option is to use some sort of job queuing system. Zend Server Job Queue has the ability to schedule repetitive tasks. I use it on my site for a lot of things. In fact, a lot of what you are trying to do. It periodically searches Twitter, processes relationships, etc. I have a message on how to use it in Are you in line? Introduction to the Zend Server Run Queue



0


a source







All Articles