in reply to Help with exponential backoff
Something like this?
my $counter = 1; while( 1 ) { if ( data_is_waiting() ) { my $data = read_data(); do_stuff( $data ); $counter = 1; } else { sleep( 2 * $counter ); $counter++ if $counter < 60; } }
| We're not surrounded, we're in a target-rich environment! |
|---|
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Help with exponential backoff
by jdtoronto (Prior) on Oct 11, 2006 at 15:47 UTC |