public void Stop() { if (calculatorGraph == null) { return; } // TODO: not to call CloseAllPacketSources if calculatorGraph has not started. using (var status = calculatorGraph.CloseAllPacketSources()) { if (!status.ok) { Logger.LogError(TAG, status.ToString()); } } using (var status = calculatorGraph.WaitUntilDone()) { if (!status.ok) { Logger.LogError(TAG, status.ToString()); } } nameTable.Remove(calculatorGraph.mpPtr); calculatorGraph.Dispose(); calculatorGraph = null; if (stopwatch != null && stopwatch.IsRunning) { stopwatch.Stop(); } OnOutput.RemoveAllListeners(); }
public void Stop() { if (graph != null) { graph.CloseInputStream(inputStream).AssertOk(); graph.WaitUntilDone().AssertOk(); } }
public void Cancel_ShouldCancelGraph() { var graph = new CalculatorGraph(validConfigText); Assert.True(graph.StartRun().ok); graph.Cancel(); Assert.AreEqual(graph.WaitUntilDone().code, Status.StatusCode.Cancelled); }
public void Cancel_ShouldCancelGraph() { using (var graph = new CalculatorGraph(_ValidConfigText)) { Assert.True(graph.StartRun().Ok()); graph.Cancel(); Assert.AreEqual(Status.StatusCode.Cancelled, graph.WaitUntilDone().Code()); } }
public void LifecycleMethods_ShouldControlGraphLifeCycle() { var graph = new CalculatorGraph(validConfigText); Assert.True(graph.StartRun().ok); Assert.False(graph.GraphInputStreamsClosed()); Assert.True(graph.WaitUntilIdle().ok); Assert.True(graph.CloseAllPacketSources().ok); Assert.True(graph.GraphInputStreamsClosed()); Assert.True(graph.WaitUntilDone().ok); Assert.False(graph.HasError()); }
public void Stop() { if (graph != null) { var status = graph.CloseAllPacketSources(); if (!status.ok) { Debug.LogError(status.ToString()); } graph.WaitUntilDone().AssertOk(); } }
public void Stop() { if (graph == null) { return; } using (var status = graph.CloseAllPacketSources()) { if (!status.ok) { Debug.LogError(status.ToString()); } } using (var status = graph.WaitUntilDone()) { if (!status.ok) { Debug.LogError(status.ToString()); } } }