five icon indicating copy to clipboard operation
five copied to clipboard

Implement five.tooSlowAsync

Open matankb opened this issue 9 years ago • 2 comments

five.tooSlow provides the much-needed capability to get five slowly, however, it has one flaw - it's blocking. This could prove to be problematic in applications that need five slowly, but want to do other things while waiting for five.

five.tooSlowAsync is a solution to that problem. It, too, produces five after ~500 milliseconds, but does so asynchronously. It accepts a callback, which 5 is passed to after ~500 milliseconds.

This function will hopefully solve this challenge that many modern applications face - the need to retrieve five slowly, while simultaneously executing other code.

matankb avatar Mar 27 '16 22:03 matankb

It might not come as a surprise that the 500ms blocking was intentional. It wouldn't be "too slow" otherwise.

An "async" tooSlow is probably more like this, where you get feedback about 5 months later. Would you mind adjusting to match? Or even escalating the delay to 5 years?

shackpank avatar Oct 13 '16 20:10 shackpank

That's a good point. However, I'm sure that different applications will have different needs. What do you think about adding a second paramater - which could be one of milliseconds, seconds, minutes, hours, days, weeks, months, years - to decide how long it will wait for?

matankb avatar Dec 11 '16 15:12 matankb