A
arun.hallan
I need the following functionality.
public Object RunValuation
{
run process that writes to database
check the database every second to check if results are ready
when results are ready, retrieve them and return object with data
in it
}
I'm wondering how to poll the database every second? I could use a
timer, but then how do i return the object if the timer has to call
another method?
The only way i can think of is having a neverending loop, that breaks
when the results are ready. There could be a Thread.Sleep in the loop
to make the thread wait a second.
Can anyone tell me what the best practice is for something like this?
Thanks,
Arun
public Object RunValuation
{
run process that writes to database
check the database every second to check if results are ready
when results are ready, retrieve them and return object with data
in it
}
I'm wondering how to poll the database every second? I could use a
timer, but then how do i return the object if the timer has to call
another method?
The only way i can think of is having a neverending loop, that breaks
when the results are ready. There could be a Thread.Sleep in the loop
to make the thread wait a second.
Can anyone tell me what the best practice is for something like this?
Thanks,
Arun