Beispiel #1
0
        public async Task NextBatch(TState state)
        {
            var result = await Query(state);

            if (result == null)
            {
                return;
            }

            var resources = result.ToArray();

            if (!resources.Any())
            {
                return;
            }

            var batchId = _batchJobClient.StartNew(x =>
            {
                foreach (var methodName in OnStartedMethodNames())
                {
                    x.Enqueue(() => CallNotificationMethod(methodName, state));
                }

                foreach (var resource in resources)
                {
                    x.Enqueue(() => Next(resource));
                }
            });

            _batchJobClient.ContinueBatchWith(
                batchId,
                x => x.Enqueue(() => NextBatch(state)));
        }
 public string ContinueBatch(string id)
 {
     return(_batchClient.ContinueBatchWith(id, x => x.Enqueue <TestService>(a => a.TestFinish())));
 }