问题
The official documenation of version 2.3 https://apacheignite-sql.readme.io/docs/linq states this sample:
ICache<EmployeeKey, Employee> employeeCache = ignite.GetCache<EmployeeKey, Employee>(CacheName);
IQueryable<ICacheEntry<EmployeeKey, Employee>> queryable = cache.AsCacheQueryable();
Employee[] interns = queryable.Where(emp => emp.Value.IsIntern).ToArray();
I saw that ICache{TK, TV} has plenty of async support and am wondering whether it is possible to run Linq queries with async/await?
回答1:
Apache Ignite does not have async methods for Linq.
Anyway, you can always use the construction like this:
var query = queryable.Where(emp => emp.Value.IsIntern);
var task = Task.Run(() => query.ToArray());
task.Wait();
var res = task.Result;
来源:https://stackoverflow.com/questions/49100387/does-apache-ignite-linq-support-async-await