On Wed, Mar 3, 2010 at 1:11 AM, Jian <[email protected]> wrote: > I did tried not to unset the $pheanstalk object before. It produces > same result. > > In the second script (Step 2), you might notice that there are two(2) > unset lines.
PHP probably doesn't close the connection immediately during the call to unset. The second reservation grabs job 2 because job 1 is still reserved by the previous connection. Then, between that browser request and the next, there is enough time for PHP to close the two connections that hold reservations and for beanstalkd to get two FIN packets and release the two jobs. Finally, another browser request comes in and reserves job 1 again. You can test this by explicitly closing the socket before unsetting the $pheanstalk variable. I'm not sure how you would do that -- it depends on the Pheanstalk interface or PHP. In that case, I would expect job 1 to be reserved every time, never job 2. kr -- You received this message because you are subscribed to the Google Groups "beanstalk-talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/beanstalk-talk?hl=en.
