Beispiel #1
0
        private Result <IssueData[]> ProcessIssueBatch(ElasticThreadPool pool, string projectId, string filterId, int pageNumber, int issuesInBatch, Tuplet <bool> canceled, Result <IssueData[]> result)
        {
            pool.QueueWorkItem(HandlerUtil.WithEnv(delegate {
                // TODO (steveb): use result.IsCanceled instead of shared tuple once cancellation is supported on the result object

                // check if request has been canceled
                if (!canceled.Item1)
                {
                    IssueData[] issuesForBatch;
                    if (!string.IsNullOrEmpty(filterId))
                    {
                        issuesForBatch = _service.mc_filter_get_issues(_username, _password, projectId, filterId, pageNumber.ToString(), issuesInBatch.ToString());
                    }
                    else
                    {
                        issuesForBatch = _service.mc_project_get_issues(_username, _password, projectId, pageNumber.ToString(), issuesInBatch.ToString());
                    }
                    result.Return(issuesForBatch);
                }
                else
                {
                    // TODO (steveb): throw a more specific exception
                    result.Throw(new Exception("unspecified error"));
                }
            }, TaskEnv.Clone()));
            return(result);
        }
Beispiel #2
0
 public bool CanHandleFileExtension(string fileExtension)
 {
     return(HandlerUtil.ExtensionInList(extensions, fileExtension));
 }