Closed canndrew closed 8 years ago
This is a needed changed indeed, my only concern is that the crate currently builds on stable and it won't build anymore with this change.
Could you but this behind an unstable
feature that is disabled by default? Then you can just enable the feature in crust.
Also I think that allowing the user to configure the timeout would be nice. I'd add search_gateway_timeout
and search_gateway_from_timeout
.
Done and done.
Oh I just realized that you removed the timeouts for the the functions without configurable timeouts. Leaving 1 second for those would have been fine. No worries, I'll add them when the timeouts are stabilized.
search_gateway_from
can block forever without any way to kill it. This sets a one second timeout waiting for a response from the gateway. An alternative would be to add something likeAlthough realistically if the gateway doesn't respond after one second it's unlikely to ever respond.