private void ScheduleWorkers(
            JobCancellationUnit cancellationUnit,
            BlockingCollection <T> stream)
        {
            try
            {
                // single task / synchronous workers pattern...
                this.ThrowIfSuccessorCancelled(cancellationUnit);

                GetWorker()
                    (stream,
                    () => this.ThrowIfSuccessorCancelled(cancellationUnit));
            }
            catch (TaskCanceledException)
            {
                // our sucessors should have stopped, but lets dot the i's...
                throw;
            }
            catch (Exception ex)
            {
                // because we're the first in the job, don't cause a cancel if we
                // fail, just say we're finished.  This gives everything further down
                // stream a chance to process all the data we've gathered so far.

                // TODO: logging

                throw; // currently throwing.  though I think this will cause a cancel
                // on the token.  but we do want to report the exceptioned status of this
                // task, but just not cause everything else to stop immediately.
            }
            finally
            {
                stream.CompleteAdding();
            }
        }
        public static HttpWebResponse GetResponseFromServer(string path)
        {
            GetWorker target = new GetWorker(path);

            target.DoWork();
            return(target.GetResponse());
        }
        private static bool ExecuteGetWorker(string url)
        {
            GetWorker target = new GetWorker(url);

            target.DoWork();
            _responseData = target.GetResponseData();

            return(target.WasHTTPS);
        }
        public Role GetByCode(string code, AasRoleSO search)
        {
            Role result = null;

            try
            {
                result = GetWorker.GetByCode(code, search);
            }
            catch (Exception ex)
            {
                LogSystem.Error(ex);
                result = null;
            }

            return(result);
        }
Beispiel #5
0
        public Employee GetByLoginname(string loginname, PcsEmployeeSO search)
        {
            Employee result = null;

            try
            {
                result = GetWorker.GetByLoginname(loginname, search);
            }
            catch (Exception ex)
            {
                LogSystem.Error(ex);
                result = null;
            }

            return(result);
        }
Beispiel #6
0
        public Employee GetById(long id, PcsEmployeeSO search)
        {
            Employee result = null;

            try
            {
                result = GetWorker.GetById(id, search);
            }
            catch (Exception ex)
            {
                LogSystem.Error(ex);
                result = null;
            }

            return(result);
        }
Beispiel #7
0
        public List <Employee> Get(PcsEmployeeSO search, CommonParam param)
        {
            List <Employee> result = new List <Employee>();

            try
            {
                result = GetWorker.Get(search, param);
            }
            catch (Exception ex)
            {
                param.HasException = true;
                LogSystem.Error(ex);
                result.Clear();
            }
            return(result);
        }
Beispiel #8
0
        public Application GetByCode(string code, AasApplicationSO search)
        {
            Application result = null;

            try
            {
                result = GetWorker.GetByCode(code, search);
            }
            catch (Exception ex)
            {
                LogSystem.Error(ex);
                result = null;
            }

            return(result);
        }
        public CredentialData GetById(long id, AasCredentialDataSO search)
        {
            CredentialData result = null;

            try
            {
                result = GetWorker.GetById(id, search);
            }
            catch (Exception ex)
            {
                LogSystem.Error(ex);
                result = null;
            }

            return(result);
        }
        public List <CredentialData> Get(AasCredentialDataSO search, CommonParam param)
        {
            List <CredentialData> result = new List <CredentialData>();

            try
            {
                result = GetWorker.Get(search, param);
            }
            catch (Exception ex)
            {
                param.HasException = true;
                LogSystem.Error(ex);
                result.Clear();
            }
            return(result);
        }
Beispiel #11
0
        public User GetByLoginname(string loginname, AasUserSO search)
        {
            User result = null;

            try
            {
                result = GetWorker.GetByLoginname(loginname, search);
            }
            catch (Exception ex)
            {
                LogSystem.Error(ex);
                result = null;
            }

            return(result);
        }
Beispiel #12
0
        public Post GetById(long id, PcsPostSO search)
        {
            Post result = null;

            try
            {
                result = GetWorker.GetById(id, search);
            }
            catch (Exception ex)
            {
                LogSystem.Error(ex);
                result = null;
            }

            return(result);
        }
Beispiel #13
0
        public UserRole GetById(long id, AasUserRoleSO search)
        {
            UserRole result = null;

            try
            {
                result = GetWorker.GetById(id, search);
            }
            catch (Exception ex)
            {
                LogSystem.Error(ex);
                result = null;
            }

            return(result);
        }
Beispiel #14
0
        public Application GetById(long id, AasApplicationSO search)
        {
            Application result = null;

            try
            {
                result = GetWorker.GetById(id, search);
            }
            catch (Exception ex)
            {
                LogSystem.Error(ex);
                result = null;
            }

            return(result);
        }
Beispiel #15
0
        public Address GetById(long id, PcsAddressSO search)
        {
            Address result = null;

            try
            {
                result = GetWorker.GetById(id, search);
            }
            catch (Exception ex)
            {
                LogSystem.Error(ex);
                result = null;
            }

            return(result);
        }
        public Project GetByCode(string code, PcsProjectSO search)
        {
            Project result = null;

            try
            {
                result = GetWorker.GetByCode(code, search);
            }
            catch (Exception ex)
            {
                LogSystem.Error(ex);
                result = null;
            }

            return(result);
        }