SmartQuant Discussion

What does the event EventManagerStopped do?
Page 1 of 1

Author:  abasqd [ Thu Apr 04, 2019 5:13 am ]
Post subject:  What does the event EventManagerStopped do?

Can somebody explain why when running this code and then stopping the EventManager, "StopTest::Stopping" and "StopTest::Done" never print? thanks

using System;
using System.Threading;

using SmartQuant;

namespace OpenQuant
public class StopTest
public bool Stopped = false;
public Framework Framework;

public void Stop(object sender, EventArgs e)
Framework.EventManager.Dispatcher.EventManagerStopped -= Stop;
Stopped = true;
public void Run()
Framework = Framework.Current;
Framework.EventManager.Dispatcher.EventManagerStopped += Stop;

while (!Stopped)
public static void Main(string[] args)
StopTest stopTest = new StopTest();

Author:  skuvv [ Mon Jul 08, 2019 12:11 pm ]
Post subject:  Re: What does the event EventManagerStopped do?

Hello, abasqd.
When you call Console.WriteLine(...), the message will be placed in queue.
In this moment EventManager can be stopped and message still in queue and will not be read/printed.

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group