public async void QueryCineastAndProcess(SimilarityQuery query, bool camera) { bool f = false; var res = await Task.Run(async() => { var results = await Task.Run(async() => await CineastWrapper.ExecuteQuery(query, 100, 100)); Debug.Log("Results received. Fetching objectdata"); await ObjectRegistry.Initialize(false); // Works due to collection being less than 100 and 100 are prefetched Debug.Log("Objectdata Fetched"); await ObjectRegistry.BatchFetchObjectMetadata(ObjectRegistry.Objects); Debug.Log("Metadata fetched"); Debug.Log("Fetched resutls: " + results.results.Count); f = true; return(results); }); Debug.Log("Handling Result"); while (f == false) { Debug.Log("waiting"); } Debug.Log("finished"); HandleCineastResult(ObjectRegistry.Objects, camera); // TODO more sophisticated }
public async void QueryCineastAndProcess(SimilarityQuery query) { var res = await Task.Run(async() => { var results = await Task.Run(async() => await CineastWrapper.ExecuteQuery(query, 100, 100)); Debug.Log("Results received. Fetching objectdata"); await ObjectRegistry.Initialize(false); // Works due to collection being less than 100 and 100 are prefetched Debug.Log("Objectdata Fetched"); await ObjectRegistry.BatchFetchObjectMetadata(ObjectRegistry.Objects); Debug.Log("Metadata fetched"); return(results); }); HandleCineastResult(ObjectRegistry.Objects); // TODO more sophisticated }