Ignore:
Timestamp:
11/23/15 21:18:26 (4 years ago)
Author:
jkarder
Message:

#2258: added StartAsync to IExecutable

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Async/HeuristicLab.Core/3.3/Executable.cs

    r12012 r13349  
    2222using System;
    2323using System.Drawing;
     24using System.Threading;
     25using System.Threading.Tasks;
    2426using HeuristicLab.Common;
    2527using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     
    8284      ExecutionTime = TimeSpan.Zero;
    8385    }
    84     public virtual void Start() {
     86    public void Start() {
     87      StartAsync().Wait();
     88    }
     89    public async Task StartAsync() {
     90      await StartAsync(new CancellationToken());
     91    }
     92    public virtual async Task StartAsync(CancellationToken cancellationToken) {
    8593      if ((ExecutionState != ExecutionState.Prepared) && (ExecutionState != ExecutionState.Paused))
    8694        throw new InvalidOperationException(string.Format("Start not allowed in execution state \"{0}\".", ExecutionState));
Note: See TracChangeset for help on using the changeset viewer.