Hi all,
If I use a 'Send "myHandler" in n seconds' which will write some info to a socket but at the same time that it runs (in the n amount of seconds) I have another handler that will need to write to that socket too, is there some way that my second handler can tell if the other is running?
I can tell if it is in the queue to run and I suppose that if it's not in the PendingMessages list then it must be running (or has finished running perhaps). The executionContexts is useful for finding out the current handler and line number but I cant seem to get it to list more than one item, only the one that the 'get the executionContexts' line is actually in.
So, what i'm really asking is Can I Get a List of the Currently Running Handlers? Or is there only EVER the one handler running and the others are held in a queue in the pendingMessages list?
Many thanks
Pi
Get running process and pending
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Get running process and pending
Hi ∏,
I don't know of a simple way to retrieve a list of currently running handlers. I also wonder if this is practical, because usually handlers run for only a few milliseconds and your list of running handlers will be empty most of the time.
If a handler needs to know which other handler triggered it with a "send in time" handler, you can send the context along as a parameter:
and you could keep a list of running handlers when they are called:
Kind regards,
Mark
I don't know of a simple way to retrieve a list of currently running handlers. I also wonder if this is practical, because usually handlers run for only a few milliseconds and your list of running handlers will be empty most of the time.
If a handler needs to know which other handler triggered it with a "send in time" handler, you can send the context along as a parameter:
Code: Select all
put line -1 of the executioncontexts into myContext
send "someHandler myContext" to me in 5 seconds
Code: Select all
global gHandlerList
on someHandler theContext
put line -1 of the executionContexts & tab & theContext & cr after gHandlerList
// your script here
end someHandler
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Get running process and pending
why did you hijack this thread? you could have started your own, or looked a couple lines down to this thread http://forums.runrev.com/viewtopic.php?f=9&t=12745
Re: Get running process and pending
Spammers like to hijack threads!
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Get running process and pending
They have 1 post, you have over 3900.. 
