[squeak-dev] How to call irsend

David T. Lewis lewis at mail.msen.com
Fri Feb 8 17:43:37 UTC 2013


On Fri, Feb 08, 2013 at 12:00:06PM -0500, Louis LaBrunda wrote:
> Hi Dave,
> 
> OSProcess class>>waitForCommand: (and what it calls) looks good but what if
> runState never gets to #complete?  Would it loop forever or can't that
> happen.  For now, I wait a second and after 50 tries give up and try the
> command again.  I retry the command 50 times and then give up and
> reschedule the request for the next time.

I wouldn't say that it can't happen, but the completion notification is
fairly reliable and I doubt there is any way for your irsend command to
not exit. Since you are just running a simple command, I don't think you
have anything to worry about, it should just work.

Dave

> 
> If I could be sure of completion (or if you added a completion limit, not
> that I'm asking) it would simplify my code.
> 
> Lou
> 
> >That sound right to me. The exit status of the program is set some time
> >after it exits (by means of a unix signal triggering a Smalltalk semaphore
> >which wakes up a process that updates the status in the ExternalUnixOSProcess).
> 
> >For a simple command line program like this, just waiting a couple hundred
> >milliseconds after you evaluate the command will allow time for the program
> >to run and for Squeak to be informed of the outcome. So a retry loop with
> >200ms delay is probably fine in this case. Come to think of it, there's
> >an OSProcess class>>waitForCommand: that will probably do exactly what you
> >want in this case.
> -----------------------------------------------------------
> Louis LaBrunda
> Keystone Software Corp.
> SkypeMe callto://PhotonDemon
> mailto:Lou at Keystone-Software.com http://www.Keystone-Software.com
> 


More information about the Squeak-dev mailing list