Changeset 16993 for branches/2924_DotNetCoreMigration/HeuristicLab.PluginInfrastructure/3.3/Isolation/Runner.cs
- Timestamp:
- 05/29/19 12:16:15 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2924_DotNetCoreMigration/HeuristicLab.PluginInfrastructure/3.3/Isolation/Runner.cs
r16984 r16993 4 4 using System.Runtime.Serialization; 5 5 using System.Runtime.Serialization.Formatters.Binary; 6 using System.Text;7 6 using System.Threading; 8 7 … … 11 10 public abstract class Runner : IRunner { 12 11 12 #region Vars 13 13 [NonSerialized] 14 14 private Thread listener; … … 19 19 [NonSerialized] 20 20 protected static IFormatter formatter = new BinaryFormatter(); 21 21 #endregion 22 23 #region Properties 22 24 public bool QuietMode { get; set; } 23 25 24 26 public IEnumerable<AssemblyInfo> AssembliesToLoad { get; set; } 27 #endregion 28 25 29 26 30 public static void Serialize(IRunner runner, Stream stream) => formatter.Serialize(stream, runner); … … 41 45 protected abstract void OnRunnerJob(RunnerJob runnerJob); 42 46 47 #region Helper 43 48 private void StartExecutor() { 44 49 executor = new Thread(Execute); … … 46 51 executor.Start(); 47 52 } 53 48 54 private void StartListener() { 49 55 listener = new Thread(() => { 50 56 Stream stdin = Console.OpenStandardInput(); 51 while (executor.IsAlive) 57 while (executor.IsAlive) 52 58 OnRunnerJob((RunnerJob)formatter.Deserialize(stdin)); 53 59 }); … … 55 61 listener.Start(); 56 62 } 57 63 #endregion 58 64 } 59 65 }
Note: See TracChangeset
for help on using the changeset viewer.