View previous topic :: View next topic |
Author |
Message |
Rebel49 Contributor
Joined: 23 Aug 2002 Posts: 78 Location: Nova Scotia, Canada
|
Posted: Sun Mar 20, 2005 12:53 pm Post subject: Event Queue |
|
|
Would it be possible to have multiple events stored in a queue or buffer?
As I write VDS apps they often grow and grow and get more complex.
I eventually find I have difficulty picking up every event expecially
unexpected network events (such as via VDSIPP). At first thought,
It seems to me that if they were queued I could more easily
process them. I guess you would also need to check queue size
and even have the ability to flush.
REB _________________ OLD and eager! |
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Sun Mar 20, 2005 11:37 pm Post subject: |
|
|
what about storing them in a list, something like
Code: |
:evloop
wait event
list add, 1, @event()
goto evloop
|
this way, you could do a @COUNT() to see if there are any events to process and flushing the queue is very easy as you just need to clear the list
serge _________________
|
|
Back to top |
|
|
Rebel49 Contributor
Joined: 23 Aug 2002 Posts: 78 Location: Nova Scotia, Canada
|
Posted: Mon Mar 21, 2005 2:05 am Post subject: |
|
|
Hi Serge;
Thats a good thought and I will certainly keep that approach in mind.
But it seems to me the problem I encounter is that while the script
executes outside this loop, two events sometimes occur. For Instance,
my apps involve constant device polling via SNMP protocol and VDSIPP.
So I get many UDP ON MESSAGE events rapidly and also unpredictably
as well. So if a button CLICK happened while outside the loop it could
get dumped by the ONUDP message event. By the time the script comes
back to the loop it may only have 1 event to add to the list while two have
actually occured. I hope this makes a bit of sense.
And like I mentioned, the scripts get complex managing SNMP
data dumps so a built in queue would seem to be most helpful.
Many thanks for your input
REB _________________ OLD and eager! |
|
Back to top |
|
|
PGWARE Web Host
Joined: 29 Dec 2001 Posts: 1563
|
Posted: Mon Mar 21, 2005 4:54 am Post subject: |
|
|
I'd recommend running the actual UDP within it's own process/exe and then sending back the data to the program/exe with a GUI to display the data. This allows the internet connectivity exe/app to run in it's own processes without having to worry about any other events to handle other then internet related events. |
|
Back to top |
|
|
jules Professional Member
Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Mon Mar 21, 2005 8:59 am Post subject: |
|
|
PG's advice is sound as regards the working of extensions. VDS is not suited to handling activities that generate large numbers of events. However, VDS (since version 5) does queue events, so I don't know why this topic is in "wish list." _________________ The Tech Pro
www.tech-pro.net |
|
Back to top |
|
|
Rebel49 Contributor
Joined: 23 Aug 2002 Posts: 78 Location: Nova Scotia, Canada
|
Posted: Mon Mar 21, 2005 11:35 am Post subject: |
|
|
Jules said.
Quote: | However, VDS (since version 5) does queue events, so I don't know why this topic is in "wish list."
|
Ooops ! Guess I should have stated I am using VDS 4. I DID
happen to browse through the help files of the demo of VDS 5
before I posted but did not spot that change.
A good reason to look forward to VDS 6 !!!
Thanks all.
REB _________________ OLD and eager! |
|
Back to top |
|
|
Rebel49 Contributor
Joined: 23 Aug 2002 Posts: 78 Location: Nova Scotia, Canada
|
Posted: Mon Mar 21, 2005 11:44 am Post subject: |
|
|
Serge suggested:
Quote: | :evloop
wait event
list add, 1, @event()
goto evloop
|
I suppose if i added
list add,1,@event
at busy and critical areas of the script, this may in fact do
what I need it do.
Thanks Serge.
REB _________________ OLD and eager! |
|
Back to top |
|
|
Rebel49 Contributor
Joined: 23 Aug 2002 Posts: 78 Location: Nova Scotia, Canada
|
Posted: Mon Mar 21, 2005 11:51 am Post subject: |
|
|
PGWARE Wrote:
Quote: | I'd recommend running the actual UDP within it's own process/exe
|
I will mull over that a bit more.Thanks
REB _________________ OLD and eager! |
|
Back to top |
|
|
Serge Professional Member
Joined: 04 Mar 2002 Posts: 1480 Location: Australia
|
Posted: Mon Mar 21, 2005 12:44 pm Post subject: |
|
|
glad to help reb
serge _________________
|
|
Back to top |
|
|
|