Exemple #1
0
        /// <summary>
        /// Encapsulates the given <paramref name="request"/> within a <see cref="GeolocationBatchUpdateJob"/>
        /// along with the <see cref="IPGeolocationProcessor"/> delegate to eventually invoke when
        /// processing begins
        /// </summary>
        /// <param name="request">The <see cref="List{T}"/> of <see cref="IPGeolocationUpdateRequest"/></param>
        /// <param name="processor">The <see cref="IPGeolocationProcessor"/> delegate to invoke at processing time</param>
        /// <returns>
        /// The assigned <see cref="Guid"/> associated with the newly created
        /// <see cref="GeolocationBatchUpdateJob"/>
        /// </returns>
        public Guid AddJob(List <IPGeolocationUpdateRequest> request, IPGeolocationProcessor processor)
        {
            var backgroundJob = new GeolocationBatchUpdateJob(request, processor);

            PendingJobs.Add(backgroundJob);

            return(backgroundJob.Id);
        }
Exemple #2
0
 public GeolocationBatchUpdateJob(List <IPGeolocationUpdateRequest> request, IPGeolocationProcessor processor) : base(request)
 {
     RequestItemCount   = request.Count;
     RemainingItemCount = RequestItemCount;
     Processor          = processor;
 }