Re: anyone found a way around 4-5 second latency in read from process?

2010-02-11 Thread Bernard Devlin
On Wed, Feb 10, 2010 at 5:12 PM, Josh Mellicker  wrote:
> Thanks Bernard, good tips... I am experiencing this delay compared to running 
> the same command in Terminal in OS X... I have also tried changing the
> idleRate but that doesn't seem to affect "read from process". Perhaps an 
> external is the best solution.

Josh,

I would think devising, testing and including a cross platform
external was the last thing I'd do.

What does the application do that you're opening with "read from
process"?  Is it network or hardware-related - could that be
introducing the delay?  Or is this latency something that occurs wth
everything to do with "read from process" on OS X?  I really don't
remember seeing such a delay on OS X.  Is it possible you can do a
test and see if e.g. just running 'ls' and reading back the results
comes with a 5 second delay on OS X.  If so, it really should be
entered into RQCC. I searched RQCC and can see no report on this.

If even the simple test I outlined proves your case then, you may have
to look for another solution :-/

Bernard
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: anyone found a way around 4-5 second latency in read from process?

2010-02-10 Thread Josh Mellicker
Thanks Bernard, good tips... I am experiencing this delay compared to running 
the same command in Terminal in OS X... I have also tried changing the idleRate 
but that doesn't seem to affect "read from process". Perhaps an external is the 
best solution.


On Feb 9, 2010, at 2:22 AM, Bernard Devlin wrote:

> On Mon, Feb 8, 2010 at 8:24 PM, Josh Mellicker  wrote:
>> Things are working, but there is always about a 4 - 5 second latency in the 
>> "read from process".  > Usually this doesn't matter, but in our current 
>> project it needs to be within a second or less.
> 
> In the situations where I've used "read from process" this latency
> would make it a total non-starter.  I think there is something unusual
> in your circumstances.
> 
> I have just been working on a small module that uses "read from
> process", and the same action launched from a command line takes 5
> seconds, as it does if it was run using "read from process".  So your
> experience of latency is unusual.  Maybe it is something to do with
> the startup time of the application you are opening as a process?  I'm
> running on Vista here, but I've used "read from process" on OS X too
> with no noticeable delays
> 
> I would try timing the same action using a command line script to see
> if there is really a latency with "read from process".
> 
> Bernard
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: anyone found a way around 4-5 second latency in read from process?

2010-02-09 Thread Bernard Devlin
On Mon, Feb 8, 2010 at 8:24 PM, Josh Mellicker  wrote:
> Things are working, but there is always about a 4 - 5 second latency in the 
> "read from process".  > Usually this doesn't matter, but in our current 
> project it needs to be within a second or less.

In the situations where I've used "read from process" this latency
would make it a total non-starter.  I think there is something unusual
in your circumstances.

I have just been working on a small module that uses "read from
process", and the same action launched from a command line takes 5
seconds, as it does if it was run using "read from process".  So your
experience of latency is unusual.  Maybe it is something to do with
the startup time of the application you are opening as a process?  I'm
running on Vista here, but I've used "read from process" on OS X too
with no noticeable delays

I would try timing the same action using a command line script to see
if there is really a latency with "read from process".

Bernard
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: anyone found a way around 4-5 second latency in read from process?

2010-02-08 Thread Josh Mellicker
Thanks Sarah! That could be just the ticket for some projects.

I wonder if there is any way to designate a pipe in memory, rather than a text 
file on disk... I fear the constant disk access might disrupt other things 
going on.

I wonder if a "generic external" could be written for the sole purpose of 
porting commands from Rev to external executables, and receiving the output... 
such that you would need to define the type of data when sending the command 
from Rev... just dreaming here...


On Feb 8, 2010, at 2:09 PM, Sarah Reichelt wrote:

> On Tue, Feb 9, 2010 at 6:24 AM, Josh Mellicker  wrote:
>> We have been experimenting with many combinations of syntax variants  for 
>> "open process"/"read from process" to communicate with various command-line 
>> driven executables.
>> 
>> We are using a callback loop to read from process, and have tried from 1 to 
>> 800 milliseconds to try and speed up response.
>> 
>> We have tried read from process until lf, until cr, until eof, until empty, 
>> etc.
>> 
>> Things are working, but there is always about a 4 - 5 second latency in the 
>> "read from process". Usually this doesn't matter, but in our current project 
>> it needs to be within a second or less.
>> 
>> 
>> So, I am wondering:
>> 
>> 1. Is there something we could do to eliminate this delay, some syntax we 
>> haven't yet tried?
>> 
>> 2. Have other developers noticed this latency in the Rev I/O pipeline?
>> 
>> 3. Would writing an Rev external that served as a middleman between Rev and 
>> a command-line driven executable eliminate this problem and provide near 
>> real time communication?
>> 
>> 4. Is there another way to communicate with command-line driven executables 
>> (other than "shell", which doesn't provide for a callback loop to monitor 
>> output)
> 
> 
> I use shell with the output piped to a text file that I can monitor.
> Here is an example script that I use for pinging:
> 
> function checkPing pIP
>put specialFolderPath("Desktop") & "/ping.txt" into tFileName
>if there is a file tFileName then delete file tFileName
> 
>put "ping -c1 -n "  & pIP into tShellCmd
>put " > " & tFileName & " 2>&1 &" after tShellCmd
>get shell(tShellCmd)
> 
>put 0 into timeCheck
>repeat 50 times
>add 1 to timeCheck
>wait 1 tick with messages
>if there is a file tFileName then
>put URL ("file:" & tFileName) into tRes
>if tRes is empty then next repeat  -- file created but no result 
> yet
> 
>put wordOffset("loss", tRes) into tWord
>if tWord = 0 then next repeat -- file created but result
> not complete
> 
>-- if there is a file tFileName then delete file tFileName
>put word tWord-2 of tRes into tPercent
>if tPercent = "0%" then return true
>else return false
>end if
>end repeat
> 
>if there is a file tFileName then delete file tFileName
>return false
> end checkPing
> 
> Cheers,
> Sarah
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: anyone found a way around 4-5 second latency in read from process?

2010-02-08 Thread Sarah Reichelt
On Tue, Feb 9, 2010 at 6:24 AM, Josh Mellicker  wrote:
> We have been experimenting with many combinations of syntax variants  for 
> "open process"/"read from process" to communicate with various command-line 
> driven executables.
>
> We are using a callback loop to read from process, and have tried from 1 to 
> 800 milliseconds to try and speed up response.
>
> We have tried read from process until lf, until cr, until eof, until empty, 
> etc.
>
> Things are working, but there is always about a 4 - 5 second latency in the 
> "read from process". Usually this doesn't matter, but in our current project 
> it needs to be within a second or less.
>
>
> So, I am wondering:
>
> 1. Is there something we could do to eliminate this delay, some syntax we 
> haven't yet tried?
>
> 2. Have other developers noticed this latency in the Rev I/O pipeline?
>
> 3. Would writing an Rev external that served as a middleman between Rev and a 
> command-line driven executable eliminate this problem and provide near real 
> time communication?
>
> 4. Is there another way to communicate with command-line driven executables 
> (other than "shell", which doesn't provide for a callback loop to monitor 
> output)


I use shell with the output piped to a text file that I can monitor.
Here is an example script that I use for pinging:

function checkPing pIP
put specialFolderPath("Desktop") & "/ping.txt" into tFileName
if there is a file tFileName then delete file tFileName

put "ping -c1 -n "  & pIP into tShellCmd
put " > " & tFileName & " 2>&1 &" after tShellCmd
get shell(tShellCmd)

put 0 into timeCheck
repeat 50 times
add 1 to timeCheck
wait 1 tick with messages
if there is a file tFileName then
put URL ("file:" & tFileName) into tRes
if tRes is empty then next repeat  -- file created but no result yet

put wordOffset("loss", tRes) into tWord
if tWord = 0 then next repeat -- file created but result
not complete

-- if there is a file tFileName then delete file tFileName
put word tWord-2 of tRes into tPercent
if tPercent = "0%" then return true
else return false
end if
end repeat

if there is a file tFileName then delete file tFileName
return false
end checkPing

Cheers,
Sarah
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


anyone found a way around 4-5 second latency in read from process?

2010-02-08 Thread Josh Mellicker
We have been experimenting with many combinations of syntax variants  for "open 
process"/"read from process" to communicate with various command-line driven 
executables.

We are using a callback loop to read from process, and have tried from 1 to 800 
milliseconds to try and speed up response.

We have tried read from process until lf, until cr, until eof, until empty, etc.

Things are working, but there is always about a 4 - 5 second latency in the 
"read from process". Usually this doesn't matter, but in our current project it 
needs to be within a second or less.


So, I am wondering:

1. Is there something we could do to eliminate this delay, some syntax we 
haven't yet tried?

2. Have other developers noticed this latency in the Rev I/O pipeline?

3. Would writing an Rev external that served as a middleman between Rev and a 
command-line driven executable eliminate this problem and provide near real 
time communication?

4. Is there another way to communicate with command-line driven executables 
(other than "shell", which doesn't provide for a callback loop to monitor 
output)

Thanks for any light anyone can shed on 
this.___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution