public ActionResult StartGame(string playerId) { lock (_game) { return(_game.Start(playerId)); } }
private void StartService( IStartable service, string serviceName) { try { #region Logging _log.Info($"{serviceName} is starting."); #endregion service.Start(); #region Logging _log.Info($"{serviceName} has been started."); #endregion } catch (Exception e) { #region Logging _log.Critical(e, $"{serviceName} starting failed."); #endregion throw; } }
private void StartStopDisposeLifecycleComps(IStartable start, IStartable stop, IDisposable disp, One one) { start.Start(); // post instantiation startup Assert.AreEqual(4, one.getStarting().Count); Assert.AreEqual("One", one.getStarting()[0]); Assert.AreEqual("Two", one.getStarting()[1]); Assert.AreEqual("Three", one.getStarting()[2]); Assert.AreEqual("Four", one.getStarting()[3]); stop.Stop(); // post instantiation shutdown - REVERSE order. Assert.AreEqual(4, one.getStopping().Count); Assert.AreEqual("Four", one.getStopping()[0]); Assert.AreEqual("Three", one.getStopping()[1]); Assert.AreEqual("Two", one.getStopping()[2]); Assert.AreEqual("One", one.getStopping()[3]); disp.Dispose(); // post instantiation shutdown - REVERSE order. Assert.AreEqual(4, one.getDisposing().Count); Assert.AreEqual("Four", one.getDisposing()[0]); Assert.AreEqual("Three", one.getDisposing()[1]); Assert.AreEqual("Two", one.getDisposing()[2]); Assert.AreEqual("One", one.getDisposing()[3]); }
public void Update() { for (int i = 0; i < behaviours.Count; i++) { Behaviour b = behaviours[i]; if (!b.Enabled) { continue; } if (b is IStartable) { IStartable startable = b as IStartable; if (!startable.IsStarted) { startable.Start(); startable.IsStarted = true; } } if (b is IUpdatable) { IUpdatable updatable = b as IUpdatable; updatable.Update(); } } }
internal static void SafeStart(this IStartable startable, Tracer tracer) { Contract.Requires <ArgumentNullException>(tracer != null); if (startable == null) { return; } if (startable.IsStarted) { tracer.Info("{0} already started, not restarting it.", startable); return; } try { tracer.Verbose("Starting {0} ...", startable); startable.Start(); tracer.Info("Successfully started {0}.", startable); } catch (Exception excp) { tracer.Severe(excp, "Exception Start()ing {0}", startable); } }
public override void Start() { if (_streamer == null) { InitResult(); } _parent.Start(); }
private static void StartNewTask(int number, IStartable testClass) { Console.WriteLine($"Start Multithreading Task{number} \n"); testClass.Start(); Console.WriteLine("Press key to continue"); Console.ReadKey(); Console.WriteLine(); }
public void Start(string asmName) { InitailizeBus(asmName); startable.Start(); bootStrapper.EndStart(); }
private void Run(string[] args) { if (args.Length < 1) { Console.WriteLine("No startup assembly given."); Environment.Exit(-1); } var assbly = args[0]; var param = args.Skip(1); try { AssemblyCatalog cat = new AssemblyCatalog(Assembly.LoadFrom(assbly)); CompositionContainer cont = new CompositionContainer(cat); cont.ComposeParts(this); } catch (Exception ex) { Console.WriteLine("Error while loading assembly."); Console.WriteLine(ex); Environment.Exit(-1); } if (_node == null) { Console.WriteLine("Assembly loaded, but no IStartable found."); Environment.Exit(-1); } ManualResetEvent ev = new ManualResetEvent(false); try { _node.Start(param).Wait(); } catch (Exception ex) { Console.WriteLine("Error while starting ..."); Console.WriteLine(ex); } Console.CancelKeyPress += (sender, eventArgs) => { _node.Stop(); ev.Set(); }; ev.WaitOne(); }
public void Start() { _parent.Start(); _haveBeenStarted = true; }
static void Kaynnista(IStartable laite) { laite.Start(); }
static void Start(IStartable machine) { machine.Start(); }
private void StartStopDisposeLifecycleComps(IStartable start, IStartable stop, IDisposable disp, One one) { start.Start(); // post instantiation startup Assert.AreEqual(4, one.getStarting().Count); Assert.AreEqual("One", one.getStarting()[0]); Assert.AreEqual("Two", one.getStarting()[1]); Assert.AreEqual("Three", one.getStarting()[2]); Assert.AreEqual("Four", one.getStarting()[3]); stop.Stop(); // post instantiation shutdown - REVERSE order. Assert.AreEqual(4, one.getStopping().Count); Assert.AreEqual("Four", one.getStopping()[0]); Assert.AreEqual("Three", one.getStopping()[1]); Assert.AreEqual("Two", one.getStopping()[2]); Assert.AreEqual("One", one.getStopping()[3]); disp.Dispose(); // post instantiation shutdown - REVERSE order. Assert.AreEqual(4, one.getDisposing().Count); Assert.AreEqual("Four", one.getDisposing()[0]); Assert.AreEqual("Three", one.getDisposing()[1]); Assert.AreEqual("Two", one.getDisposing()[2]); Assert.AreEqual("One", one.getDisposing()[3]); }
protected TOut GetResult() { IsInit = true; _parent.Start(); return(_accumulator); }