I think that he wants a function that acts like steTimeout(..) in
JavaScript ex:
<code>
setTimeout('alert('tst2')',5000);
setTimeout('alert('tst1')',4000);
</code>
When you exec this code in js the first alert that is executed is tst1
and then tst2.
I don't know if you can do this in php without using threads.
I am not sure that this is the only function he whants to use this way,
but if I am not wrong threading dose the job very well.

btw what is the status of that project? Is it functional yet? I havent
read the php-dev discutions on this yet.


On Wed, 2003-03-12 at 13:29, W. Enserink wrote:
> i'm not sure what you want. But you have created objects here in $a,$b and
> $c.
> If you want to order them in a special way you have to write the
> functionality of course. I think you have to do this before the object is
> created because you define the variables 10,5,1 before the objects are
> created. Once the objects are created they themselves don't know nothing
> form each other. So th eparent object has to control this, or in your case a
> 'parent piece of script'.
> 
> You can use $a,$b,and $c as regular,ordinary variables.  further on.
> 
> hope it helped,
> 
> Wilbert
> 
> ----- Original Message -----
> From: "Kris" <[EMAIL PROTECTED]>
> To: "PHP List" <[EMAIL PROTECTED]>
> Sent: Wednesday, March 12, 2003 12:18 PM
> Subject: [PHP] Threading objects
> 
> 
> > I want to be able to thread objects. I'm not really sure at all where to
> > start. but I want a script where multiple objects are being processed at
> the
> > same time.
> > I have an example php script
> >
> > <?
> >
> > $a = new sleeper();
> > $b = new sleeper();
> > $c = new sleeper();
> >
> > $a->sleepFor(10);
> > $b->sleepFor(5);
> > $c->sleepFor(1);
> >
> > class sleeper {
> >
> >  function sleepFor($num) {
> >   sleep($num);
> >   echo "sorry I was a sleep for $num \r\n";
> >  }
> >
> > }
> >
> > ?>
> >
> > I want so object $c would print then object $b then object $a as the
> > sleeping time is less and less.
> > Does that make sense? Please ask if you don't understand
> >
> > Thanks for any help you can offer what so ever.
> >
> > Kris
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> ------------------------- 
> Pas de Deux 
> Van Mierisstraat 25 
> 2526 NM Den Haag 
> tel 070 4450855 
> fax 070 4450852 
> http://www.pdd.nl
> [EMAIL PROTECTED] 
> -------------------------
-- 
Mincu Alexandru                 intelinet.ro
Tel:+4 0745 369719              +4 021 3140021
www.intelinet.ro                [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to