コード例 #1
0
        private Task DownloadTask(object taskId)
        {
            Task t = null;

            HiveClient.TryAndRepeat(() => {
                t = HiveServiceLocator.Instance.CallHiveService(s => s.GetTask((Guid)taskId));
            }, Settings.Default.MaxRepeatServiceCalls, "Failed to download task.");
            return(t);
        }
コード例 #2
0
        protected Tuple <Task, TaskData> DownloadTaskData(Task task)
        {
            downloadSemaphore.WaitOne();
            TaskData result = null;

            try {
                if (abort)
                {
                    return(null);
                }
                HiveClient.TryAndRepeat(() => {
                    result = HiveServiceLocator.Instance.CallHiveService(s => s.GetTaskData(task.Id));
                }, Settings.Default.MaxRepeatServiceCalls, "Failed to download task data.");
            }
            finally {
                downloadSemaphore.Release();
            }
            return(new Tuple <Task, TaskData>(task, result));
        }