m-wrzr / streamlit-searchbox

Streamlit searchbox that dynamically updates and provides a list of suggestions based on a provided function
MIT License
203 stars 26 forks source link

Adding delay #30

Closed Jumitti closed 3 months ago

Jumitti commented 8 months ago

FIX previous PR: int to float (my bad)

Sometime, servers where we can do requests have limit of requests per second. So adding a delay avoids this problem.

I saw in the package that there is a :param delay. Maybe you're already working on it.

This addition of delay is due to the fact that I use an API where we have an easily reachable limit. Usually 0.25 seconds is enough

m-wrzr commented 7 months ago

Hey, does this have any advantages over adding a delay to the actual search function or adding some other logic to limit requests? Adding the delay at this level would cause a delayed load of the whole component and the page aswell.