Changeset 15065 for branches/Async/HeuristicLab.Clients.OKB
- Timestamp:
- 06/26/17 09:45:36 (7 years ago)
- Location:
- branches/Async/HeuristicLab.Clients.OKB/3.3/RunCreation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Async/HeuristicLab.Clients.OKB/3.3/RunCreation/EmptyAlgorithm.cs
r13349 r15065 21 21 22 22 using System; 23 using System.Threading;24 using System.Threading.Tasks;25 23 using HeuristicLab.Common; 26 24 using HeuristicLab.Core; … … 82 80 throw new InvalidOperationException(string.IsNullOrEmpty(exceptionMessage) ? "Cannot prepare an EmptyAlgorithm." : exceptionMessage); 83 81 } 84 public override async Task StartAsync(CancellationToken cancellationToken) {82 public override void Start() { 85 83 throw new InvalidOperationException(string.IsNullOrEmpty(exceptionMessage) ? "Cannot start an EmptyAlgorithm." : exceptionMessage); 86 84 } -
branches/Async/HeuristicLab.Clients.OKB/3.3/RunCreation/OKBAlgorithm.cs
r13354 r15065 252 252 } 253 253 public void Start() { 254 StartAsync().Wait(); 255 } 256 public async Task StartAsync() { 257 await StartAsync(CancellationToken.None); 258 } 259 public async Task StartAsync(CancellationToken cancellationToken) { 254 Start(CancellationToken.None); 255 } 256 public void Start(CancellationToken cancellationToken) { 260 257 CheckUserPermissions(); 261 258 if (!ClientInformation.Instance.ClientExists && storeRunsAutomatically) { 262 259 throw new MissingClientRegistrationException(); 263 260 } 264 await Algorithm.StartAsync(cancellationToken); 261 Algorithm.Start(cancellationToken); 262 } 263 public async Task StartAsync() { await StartAsync(CancellationToken.None); } 264 public async Task StartAsync(CancellationToken cancellationToken) { 265 await Task.Factory.StartNew((ct) => Start((CancellationToken)ct), cancellationToken, cancellationToken); 265 266 } 266 267 public void Pause() {
Note: See TracChangeset
for help on using the changeset viewer.