Beispiel #1
0
        private static async Task TriggerWork(IScheduler sample)
        {
            var jobId     = Guid.NewGuid();
            var parentId1 = Guid.NewGuid();
            var parentId2 = Guid.NewGuid();

            var started = DateTimeOffset.UtcNow;

            while (DateTimeOffset.UtcNow - started < TimeSpan.FromSeconds(2))
            {
                await Task.Delay(10);

                sample.AddAsync(jobId, parentId1);
                //sample.AddAsync(jobId, parentId2);
            }
        }