Quantcast
Channel: Dynamic Timers
Viewing all articles
Browse latest Browse all 5

Dynamic Timers

$
0
0

hello all been struggling to find a way to solve a problem, i need to start a timer everytime a message is processed. each message needs its own timer.

so i need to create a new timer each time and still be able to find the timer should the user want to cancel/send straight away.

is there a way to create a queue of a structure of timers and ID numbers and have each timer when fired remove itself from the queue? or some other array like structure that i can add and remove from easily with out limitations i suspect that i can not add a structure to a queue.

Public
Structure APIObject
Public t As System.Timers.Timer
Public ID AsInteger
EndStructure
 
is the object type i wish to create and i then can set off the object to my desired timer interval each timer only fires once.
For
iCount = 0 To TheFaultList.NumElements Step 1
With TheFaultList.ListOfFaults(iCount)
If .FaultID = FaultID Then
Dim temp AsNew APIObject
temp.ID = FaultID
temp.t =
New System.Timers.Timer
temp.t.Interval = .FaultDelay
AddHandler temp.t.Elapsed, AddressOf TimerFired
aQueue.Enqueue(temp)
ExitFor
EndIf
EndWith
Next
 
Public
Sub TimerFired(ByVal sender AsObject, ByVal e As System.Timers.ElapsedEventArgs)
MyService.LogCall(TempXML)
EndSub
 
the tempxml will be populated with the appropriate details but as a student i just dont seem to grasp the technical side of this problem and i could be a million miles off or i could be very close i doubt a queue is the best way of doing it as the first in first out does not work as timers can fire at different times.
 
All help is as always much appreciated i hope the code i added (hacked up quickly my idea's) helps explain what i'm trying to do :).
 
Thanks in advance

Viewing all articles
Browse latest Browse all 5

Latest Images

Vimeo 11.10.1 by Vimeo.com, Inc.

Vimeo 11.10.1 by Vimeo.com, Inc.

Doodle Jump 3.11.36 by Lima Sky LLC

Doodle Jump 3.11.36 by Lima Sky LLC

CHECKPOINT RULES

CHECKPOINT RULES

Trending Articles


Long Distance Relationship Tagalog Love Quotes


PreSonus FireBox - handly interfaccia


Top 100 Tagalog Love Quotes Collections Online


Top 2014 Tagalog Love Quotes


Tagalog Broken Heart Quotes


Vimeo 3.16.0 by Vimeo Inc


FORECLOSURE OF REAL ESTATE MORTGAGE


Vimeo 11.6.1 by Vimeo.com, Inc.


Vimeo 11.8.2 by Vimeo.com, Inc.


Vimeo 11.9.2 by Vimeo.com, Inc.


Vimeo 11.5.1 by Vimeo.com, Inc.


Tagalog Quotes About Crush – Tagalog Love Quotes


OFW quotes : Pinoy Tagalog Quotes


Papa Jack Tagalog Love Quotes and Advice for you


Re: lwIP PIC32 port - new title : CycloneTCP a new open source stack for...


Vimeo 3.17.0 by Vimeo Inc


Vimeo 3.21.0 by Vimeo Inc


Vimeo 11.7.0 by Vimeo.com, Inc.


Vimeo 11.9.1 by Vimeo.com, Inc.


Vimeo 11.9.3 by Vimeo.com, Inc.



Latest Images

Vimeo 11.10.1 by Vimeo.com, Inc.

Vimeo 11.10.1 by Vimeo.com, Inc.

Doodle Jump 3.11.36 by Lima Sky LLC

Doodle Jump 3.11.36 by Lima Sky LLC

CHECKPOINT RULES

CHECKPOINT RULES

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>