private void button1_Click(object sender, EventArgs e) { /// stop if (redisPubSub != null) { logEvent("Stopping LightBot!", true); redisPubSub.Stop(); redisPubSub = null; pubsubThread = null; toolStripStatusLabel2.Text = "Disconnected"; } }
public void Stop() { if (_client != null) { var results = GetResults(); Console.WriteLine($"results: {results}"); Send(CHANNEL_END, $"results are in {results}"); _client.Dispose(); _client = null; } if (_pubSubServer != null) { _pubSubServer.Stop(); _pubSubServer.Dispose(); _pubSubServer = null; } _values = null; }