Planning ahead for threads and more interactivity in rev apps

John Tregea john at debraneys.com
Thu Nov 8 17:08:13 EST 2007


Dear Xavier,

Sounds like an interesting project. My thought on your problem is to reverse the issue. That is to break the larger task of interrogating and analysing the network space down into a number of tasks that can be processed when YOU are not doing something, rather than allowing the non-time-sensitive task to take over.

One way of doing this might be to do your initial search of the network domain (read active directory or whatever), then post a list of the found devices into a scrolling text field as function calls with the appropriate arguments (one per line).

i.e. checkDevice(132.678.45.0,server,fullstats) -- where checkDevice is the analysis routine you want to run, then the arguments are the ip address, the type of analysis and the scope, (or whateversuits your requirements)

Then in your idle handler you grab the first line from that field and "send" it to rev to process. Rev will always interrupt your idle process whenever you even move the mouse and hand control back to you. The longest you would have to wait is the period it takes to complete ONE handler call to analyse a specific device on the network rather than just being lost in the queue of commands somewhere.

Each time you grab the top line from the field, delete that line... Eventually the field will be empty and you know you have completed the analysis of each device that was found when you started the whole process. 

I used this technique with a teleprompter system I built for a television station once in HyperCard to send and queue required events to a central display screen using appleEvents. It worked fantastically well.

Hope this is some help (adjacent thinking I know, but sometimes that can simplify things)

Regards

John 
<DIV><FONT face=Verdana size=2> </FONT></DIV>
<p style="font-family: Arial;">Technology Director <br>Debraneys <br>+61 (0) 2 9529 0007 Office <br>+61 (0) 4 3050 6980 Mobile <br>www.debraneys.com</p>

>-----Original Message-----
>From: xavier.bury at clearstream.com [mailto:xavier.bury at clearstream.com]
>Sent: Friday, November 9, 2007 02:55 AM
>To: 'How to use Revolution'
>Subject: Planning ahead for threads and more interactivity in rev apps
>
>Hi everyone, 
> 
>In order to make an application more responsive, im thinking of 
>implementing a kind of threading so that the application can still run 
>while the GUI remains responsive. The application in question is a domain 
>scanner and it scans some hundreds of servers which takes quite a while 
>given the number of servers, their locations or type (phys. or virtual). I 
>dont need this to go faster mind you but i dont want to go slower 
>either... 
> 
>All i need is to be able to browse tabs and eventually change a setting or 
>another. 
> 
>Problem is that mouse interception is not really working because of the 
>intermittent shell calls and any mouseclick seems to get lost. Unless i 
>want to click for 1-4 minutes and wait with the mousedown which i dont 
>really fancy for anyone to suffer. 
> 
>Using "send" is also not a good idea because i use shell commands that may 
>take different times to finish - some servers are vmware slow or are 
>located in places like dubai or Prague may not respond too quickly... 
>Problem with the send command is that if you ask it to send something in 5 
>seconds and there is a process already running, the send will definitely 
>not run in 5 seconds... And worse, it may prevent intercepting your 
>mouseclick. 
> 
>I was thinking of a script that runs the shell, waits if mouseclick or 
>something like that... But last thing i want is to make this complex code 
>more complex... And im not sure the mouseclick will not be lost while the 
>script runs. 
> 
>Something "interactive" is what I am looking for... 
> 
>Last but not least, i can't (or dont want to) manage more than 1 shell 
>running at a time using a quick batch runner - meaning i'll have to manage 
>interleaving and limiting processing load. The server has other functions 
>and i can't monopolize the processors... Although this seems like my best 
>solution. 
> 
>Im just planning ahead this feature so all your ideas are welcome! Im sure 
>many of us revvers are looking for a script like this at some point for 
>applications that take time to process... 
> 
>Thanks in advance 
>Xavier 
> 
> 
>---------------------------------------------------------------------------- 
>Clearstream Services S.A. 
>42 Avenue JF Kennedy, L-1855 Luxembourg 
>Société anonyme is organised with limited liability 
>in the Grand Duchy of Luxembourg R.C.S. Luxembourg B 60911. 
> 
> 
>----------------------------------------- 
>Visit us at http://www.clearstream.com 
> 
>IMPORTANT MESSAGE 
> 
>Internet communications are not secure and therefore Clearstream
>International does not accept legal responsibility for the contents
>of this message. 
> 
>The information contained in this e-mail is confidential and may be
>legally privileged. It is intended solely for the addressee. If you
>are not the intended recipient, any disclosure, copying,
>distribution or any action taken or omitted to be taken in reliance
>on it, is prohibited and may be unlawful. Any views expressed in
>this e-mail are those of the individual sender, except where the
>sender specifically states them to be the views of Clearstream
>International or of any of its affiliates or subsidiaries. 
> 
>Legally required information for business correspondence/ 
>Gesetzliche Pflichtangaben fuer Geschaeftskorrespondenz: 
>http://deutsche-boerse.com/letterhead 
> 
>END OF DISCLAIMER
>_______________________________________________
>use-revolution mailing list
>use-revolution at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution
>




More information about the use-livecode mailing list