Ejemplo n.º 1
0
        public static T.Task <IEnumerable <Job> > GetJobsAsync(
            this CloudUtilities u,
            int lastId,
            int higherId            = int.MaxValue,
            int count               = 100,
            JobType type            = JobType.ClusRun,
            bool reverse            = false,
            CancellationToken token = default(CancellationToken))
        {
            lastId   = reverse && lastId == 0 ? int.MaxValue : lastId;
            higherId = reverse && higherId == int.MaxValue ? 0 : higherId;

            var lowJobPartitionKey  = u.GetJobPartitionKey(type, lastId, reverse);
            var highJobPartitionKey = u.GetJobPartitionKey(type, higherId, reverse);

            return(u.GetJobsAsync(lowJobPartitionKey, highJobPartitionKey, count, type, reverse, token));
        }