private EventsFileHandler() { // EventsFileHandler needs to be stopped when MantaMTA is stopping. MantaCoreEvents.RegisterStopRequiredInstance(this); // Make sure the drop folders exist. Directory.CreateDirectory(MtaParameters.BounceDropFolder); Directory.CreateDirectory(Path.Combine(MtaParameters.BounceDropFolder, _SubdirectoryForProblemEmails)); Directory.CreateDirectory(MtaParameters.FeedbackLoopDropFolder); Directory.CreateDirectory(Path.Combine(MtaParameters.FeedbackLoopDropFolder, _SubdirectoryForProblemEmails)); // Setup and start the bounce email file watcher. FileSystemWatcher bounceWatcher = new FileSystemWatcher(MtaParameters.BounceDropFolder, "*.eml"); bounceWatcher.Created += DoBounceFileProcessing; bounceWatcher.EnableRaisingEvents = true; // Setup and start the feedback loop email file watcher. FileSystemWatcher abuseWatcher = new FileSystemWatcher(MtaParameters.FeedbackLoopDropFolder, "*.eml"); abuseWatcher.Created += DoAbuseFileProcessing; abuseWatcher.EnableRaisingEvents = true; Thread t = new Thread(new ThreadStart(delegate() { DoBounceFileProcessing(bounceWatcher, new FileSystemEventArgs(WatcherChangeTypes.All, MtaParameters.BounceDropFolder, string.Empty)); DoAbuseFileProcessing(abuseWatcher, new FileSystemEventArgs(WatcherChangeTypes.All, MtaParameters.FeedbackLoopDropFolder, string.Empty)); })); t.Start(); }
/// <summary> /// Call this method to start the EventHttpForwarder. /// </summary> public void Start() { MantaCoreEvents.RegisterStopRequiredInstance(this); Thread t = new Thread(new ThreadStart(ForwardEvents)); t.IsBackground = true; t.Start(); }
/// <summary> /// Start the bulk importer. /// </summary> public void Start() { _bulkInsertThread = new Thread(new ThreadStart(DoSqlBulkInsertFromRabbitMQ)); _bulkInsertThread.IsBackground = true; _bulkInsertThread.Priority = ThreadPriority.AboveNormal; _bulkInsertThread.Start(); MantaCoreEvents.RegisterStopRequiredInstance(this); }
private MessageSender() { MantaCoreEvents.RegisterStopRequiredInstance(this); }
private QueueManager() { MantaCoreEvents.RegisterStopRequiredInstance(this); }