Example #1
0
        public async Task ExecuteAsync(StartInstance command, CancellationToken cancellationToken)
        {
            var result = await createService.ExecuteAsync(
                new CreateService(
                    command.InstanceId,
                    command.ServiceTypeUri,
                    command.IsServiceStateful,
                    command.HasPersistedState,
                    command.MinReplicas,
                    command.TargetReplicas,
                    command.PartitionScheme),
                cancellationToken);

            await Task.WhenAll(
                repository.SetExprirationQuantaAsync(command.ExpirationQuanta, cancellationToken),
                repository.SetServiceUriAsync(result.ServiceUri, cancellationToken),
                repository.SetServiceTypeUriAsync(command.ServiceTypeUri, cancellationToken)
                );
        }