Esempio n. 1
0
        /// <summary>
        /// Converts the result to the generic result object and calls the abstract method
        /// to process the data
        /// </summary>
        public void ProcessResult(IJobInput jobInput, string jobResultString)
        {
            var output = JobObjectSerializer.Deserialize <TOut>(jobResultString);

            ProcessResult((TIn)jobInput, output);
            Interlocked.Decrement(ref _jobCount);
        }
Esempio n. 2
0
        /// <summary>
        /// Converts the result to the generic result object and calls the abstract method
        /// to process the data
        /// </summary>
        public void ProcessResult(IJobInput jobInput, string jobResultString, object additionalData)
        {
            var output = JobObjectSerializer.Deserialize <TOut>(jobResultString);

            ProcessResult((TIn)jobInput, output, additionalData);
            Interlocked.Decrement(ref _jobCount);
            // Finish if no more jobs are pending
            if (Interlocked.Read(ref _jobCount) == 0)
            {
                IsFinished = true;
            }
        }
Esempio n. 3
0
        public JobResult Process(Job job, Guid clientId)
        {
            var inputString = job.GetInput();
            var inputObject = JobObjectSerializer.Deserialize <TIn>(inputString);

            try
            {
                var outputObject = Process(inputObject);
                var outputString = JobObjectSerializer.Serialize(outputObject);
                var result       = new JobResult(job, clientId, outputString);
                return(result);
            }
            catch (Exception ex)
            {
                return(new JobResult(job, clientId, ex));
            }
        }
Esempio n. 4
0
        public PackageInfo GetInfo(string packageName)
        {
            var content = File.ReadAllText(BuildInfoFileName(packageName));

            return(JobObjectSerializer.Deserialize <PackageInfo>(content));
        }