Esempio n. 1
0
        public ConversionTask(string alias, JObject obj, ServiceWorker[] workers)
        {
            GlassConversionTaskId = NEW_ID;

            GlassLog.Record(GlassTelemetryEventTypes.GLASS_SERVICE_CONVERSION_TASK_INITIALIZE, $"conversion task identifier : {GlassConversionTaskId}");

            _context = new ConversionContext(alias, obj);
            _workers = workers;

            _convertTask = Task.Run(Convert);
            // TODO: Serialize state to disk
        }
Esempio n. 2
0
        public GlassEngine(Dictionary<int, ServiceListener> listeners, ServiceWorker[] workers) : base()
        {
            GlassLog.Record(GlassTelemetryEventTypes.GLASS_SERVICE_ENGINE_START);

            _listeners  = listeners;
            _workers    = workers;

            // subscribe to listeners.
            foreach(var listener in _listeners.Values)
            {
                listener.NewWork += NewWorkEventHandler;
            }

            JobTask.Start();
        }