From: fedzor Date: 2008-02-13T11:11:49+09:00 Subject: Re: Rev/actor TCP monkey patching On Feb 12, 2008, at 8:57 PM, Tony Arcieri wrote: > The problem here is that you need to do something which yields > control back > to the Actor scheduler before it can run. The simplest thing you > can do is: > > Actor.sleep 0 > > This will yield control to the scheduler, which will process any > outstanding > messages then return control back to you (since you told it you > wanted to > sleep for 0 seconds) > > It's pretty confusing from irb, I'll admit... > > When doing anything with Actors, just remember you're "queuing up" > operations which will run later... later being whenever you call > Actor.receive. Actor.receive is the only way to defer control to > other > Actors (keeping in mind Actor.sleep is just shorthand for > Actor.receive) BTW, do you hang on IRC? #ruby-lang, seydar. So I need to do the Actor.sleep to dish out control, but how come I didn't have to do that with the version of revactor actually released? -------------------------------------------------------| ~ Ari if god gives you lemons YOU FIND A NEW GOD