Beispiel #1
0
        private static async Task CreateJob(IJobManager jobManager)
        {
            try
            {
                var jobId = await jobManager.CreateNewJobOrUpdateDefinition <SampleJobStep>(
                    string.Empty, "sample-job", nameof(SampleJobStep), new JobConfigurationData
                {
                    MaxBatchSize = 100,
                    MaxConcurrentBatchesPerWorker = 5,
                    IsIndefinite = true,
                    MaxBlockedSecondsPerCycle = 300,
                    QueueTypeName             = QueueType.Redis
                });

                var initialStep = new SampleJobStep
                {
                    Number = 1
                };

                await Nebula.GetJobQueue <SampleJobStep>(QueueType.Redis).Enqueue(initialStep, jobId);

                await jobManager.StartJobIfNotStarted(string.Empty, nameof(SampleJobStep));
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Beispiel #2
0
 public Task Enqueue(SampleJobStep item, string jobId = null)
 {
     return(Task.CompletedTask);
 }
 public Task Enqueue(SampleJobStep item)
 {
     return(Task.CompletedTask);
 }