Ejemplo n.º 1
0
        public IEnumerable <JobEntry> GetJobsForClient(String clientId, ResultContinuation token = null)
        {
            if (_tableClient.DoesTableExist("jobs"))
            {
                CloudTableQuery <JobEntry> qry =
                    (from j in Context.Jobs
                     where j.PartitionKey == clientId
                     select j).AsTableServiceQuery <JobEntry>();

                // this will return ALL jobs for given client - alternative is to use BeginExecuteSegmented and
                // manage pagination via continuation tokens or filter criteria on client side
                return(qry.Execute());
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        // Get a list of all files in the container
        private void GetFileTransferAsync()
        {
            // There are better ways of locking than using a bool, but this is quick and simple for this non-essential scenario and doesn't cause any blocking of the main thread.
            if (boolLoadingFileTransfer)
            {
                return;
            }
            else
            {
                boolLoadingFileTransfer = true;
            }
            pictureFileTransferAnimatedLoading.Visible = true;
            lvFileTransfer.Items.Clear();
            ResultContinuation continuation = null;
            BlobRequestOptions options      = new BlobRequestOptions();

            options.UseFlatBlobListing = true;
            ContainerFileTransfer.BeginListBlobsSegmented(5, continuation, options, new AsyncCallback(ListFileTransferCallback), null);
        }
Ejemplo n.º 3
0
        public IEnumerable <AzureDiagnosticLogEntry> GetEntriesInRange(string beginPartitionKey, string endPartitionKey, int?entriesLimit)
        {
            var q = (from e in CreateQuery()
                     where e.PartitionKey.CompareTo(beginPartitionKey) >= 0 && e.PartitionKey.CompareTo(endPartitionKey) < 0
                     select e).AsTableServiceQuery();

            if (entriesLimit.HasValue)
            {
                q = q.Take(entriesLimit.Value).AsTableServiceQuery();
            }
            for (ResultContinuation continuation = null; ;)
            {
                var segment = Task.Factory.FromAsync <ResultSegment <EntryType> >(q.BeginExecuteSegmented(continuation, null, null), q.EndExecuteSegmented).Result;
                foreach (var i in segment.Results)
                {
                    yield return(i);
                }
                if (!segment.HasMoreResults)
                {
                    break;
                }
                continuation = segment.ContinuationToken;
            }
        }
Ejemplo n.º 4
0
 public void SetResultContinuation(ResultContinuation rc)
 {
     _session["resultcontinuation" + this._id] = rc;
 }