Add query annotation timeout (#3874)
This commit is contained in:
@@ -188,14 +188,26 @@ std::vector<Feature> AndroidRendererFrontend::queryRenderedFeatures(const Screen
|
||||
return mapRenderer.actor().ask(fn, point, options).get();
|
||||
}
|
||||
|
||||
AnnotationIDs AndroidRendererFrontend::queryPointAnnotations(const ScreenBox& box) const {
|
||||
AnnotationIDs AndroidRendererFrontend::queryPointAnnotations(const ScreenBox& box,
|
||||
const std::chrono::milliseconds& timeout) const {
|
||||
// Waits for the result from the orchestration thread and returns
|
||||
return mapRenderer.actor().ask(&Renderer::queryPointAnnotations, box).get();
|
||||
auto future = mapRenderer.actor().ask(&Renderer::queryPointAnnotations, box);
|
||||
if (future.wait_for(timeout) != std::future_status::ready) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return future.get();
|
||||
}
|
||||
|
||||
AnnotationIDs AndroidRendererFrontend::queryShapeAnnotations(const ScreenBox& box) const {
|
||||
AnnotationIDs AndroidRendererFrontend::queryShapeAnnotations(const ScreenBox& box,
|
||||
const std::chrono::milliseconds& timeout) const {
|
||||
// Waits for the result from the orchestration thread and returns
|
||||
return mapRenderer.actor().ask(&Renderer::queryShapeAnnotations, box).get();
|
||||
auto future = mapRenderer.actor().ask(&Renderer::queryShapeAnnotations, box);
|
||||
if (future.wait_for(timeout) != std::future_status::ready) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return future.get();
|
||||
}
|
||||
|
||||
FeatureExtensionValue AndroidRendererFrontend::queryFeatureExtensions(
|
||||
|
||||
Reference in New Issue
Block a user