using System;
using System.Threading;
using System.Threading.Tasks;
namespace LeanCloud.LiveQuery
{
///
/// AVLiveQuery 扩展类
///
public static class AVLiveQueryExtensions
{
///
/// AVQuery 订阅 AVLiveQuery 的扩展方法
///
/// AVLiveQuery 对象
/// Query.
/// Cancellation token.
/// The 1st type parameter.
public static async Task> SubscribeAsync(this AVQuery query, CancellationToken cancellationToken = default(CancellationToken)) where T : AVObject {
var liveQuery = new AVLiveQuery(query);
liveQuery = await liveQuery.SubscribeAsync();
return liveQuery;
}
}
}