turbobytes / geoipdb

GeoIP related related helper functions for TurboBytes stack
MIT License
0 stars 2 forks source link

Timeout accesses to external services #5

Closed coolparadox closed 7 years ago

coolparadox commented 7 years ago

Blocking calls that access external services (currently ipinfo.io) must have a timeout so callers are not indefinitely locked.

This issue is a request for having timeouts implemented when the library reaches external services.

sajal commented 7 years ago

I suggest 5-second timeout to start with.

coolparadox commented 7 years ago

I intend to implement a timeout parameter in NewHandler() with millisecond granularity, defaulting to 5 seconds if user passes a null value.

This parameter will be used in all external queries -- ipinfo and cymru. (Libgeoip is a local access, so as I see no timeout protection is required.)

sajal commented 7 years ago

+1