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! |
|---|
In reply to Re: Help with exponential backoff
by jasonk
in thread Help with exponential backoff
by jdtoronto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |