Example #1
0
        /// <summary>
        /// Create a job out of this wrapper
        /// </summary>
        public Job CreateJob(string hash)
        {
            var jobInputString = JobObjectSerializer.Serialize(JobInput);
            var job            = new Job(Id, HandlerId, jobInputString, hash);

            return(job);
        }
Example #2
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));
            }
        }
Example #3
0
        public void Save(PackageInfo packageInfo)
        {
            var serializedInfo = JobObjectSerializer.Serialize(packageInfo);

            File.WriteAllText(BuildInfoFileName(packageInfo.PackageName), serializedInfo);
        }