Esempio n. 1
0
        public async Task <ActionResult <SortJob> > EnqueueJob(int[] values)
        {
            var pendingJob = new SortJob(
                id: Guid.NewGuid(),
                status: SortJobStatus.Pending,
                duration: null,
                input: values,
                output: null);

            await _sortJobProcessor.QueueJob(pendingJob);

            BackgroundJob.Enqueue(() => _sortJobProcessor.BackgroundProcess(pendingJob)); //hangfire fire-and-forget

            return(Ok(pendingJob));
        }