Exemple #1
0
 public JobLink(IJobStore _store)
 {
     this.StoreJob = _store;
     list          = new ListThreadSafe <oLink>();
     msg           = new QueueThreadSafe <Message>();
     urlData       = new DictionaryThreadSafe <string, string>();
 }
Exemple #2
0
 public JobSpeechEN(IJobStore _store)
 {
     this.StoreJob  = _store;
     this.queue     = new QueueThreadSafe <string>();
     this.storeUrl  = new DictionaryThreadSafe <string, string>();
     this.storePath = new DictionaryThreadSafe <string, string>();
 }
Exemple #3
0
        public JobFactory(JOB_TYPE type)
        {
            this.Messages = new QueueThreadSafe <Message>();

            this.Type  = type;
            JobHandles = new DictionaryThreadSafe <int, IJobHandle>();
        }
Exemple #4
0
 public JobFileHttp(IJobAction jobAction) : base(JOB_TYPE.FILE_HTTP_CACHE, jobAction)
 {
     msg      = new QueueThreadSafe <Message>();
     fileData = new DictionaryThreadSafe <string, string>();
     server   = new HttpServer();
     server.RequestReceived += f_server_onRequestReceived;
 }
Exemple #5
0
        public JobWorker(IJobContext jobContext, JOB_TYPE type)
        {
            this.Messages = new QueueThreadSafe <Message>();

            this.JobContext = jobContext;
            this.Id         = jobContext.f_getTotalJob() + 1;
            this.Type       = type;
            this.Status     = 1; /* 1: init */
        }
Exemple #6
0
        public fBase(IJobAction jobAction)
        {
            StoreMessages = new QueueThreadSafe <Message>();
            JobAction     = jobAction;
            //store.f_form_Add(this);
            //this.FormClosing += (se, ev) => { store.f_form_Remove(this); };

            timer_api = new System.Threading.Timer(new System.Threading.TimerCallback((obj) =>
            {
                IFORM form = (IFORM)obj;
                if (StoreMessages.Count > 0)
                {
                    Message m = StoreMessages.Dequeue(null);
                    if (m != null)
                    {
                        OnReceiveMessage?.Invoke(form, m);
                    }
                }
            }), this, 100, 100);
        }
Exemple #7
0
 public JobMessage(IJobStore _store)
 {
     this.StoreJob = _store;
     list          = new ListThreadSafe <oLink>();
     msg           = new QueueThreadSafe <Message>();
 }
Exemple #8
0
 public JobLink(IJobAction jobAction) : base(JOB_TYPE.LINK, jobAction)
 {
     list    = new ListThreadSafe <oLink>();
     msg     = new QueueThreadSafe <Message>();
     urlData = new DictionaryThreadSafe <string, string>();
 }
Exemple #9
0
 public AtController(ComPortSettings settings, Action <ComPortErrorNames, Exception> errorCallback)
 {
     port = new ComPort(settings, rcv, errorCallback);
     cmdQ = new QueueThreadSafe <AtCommand>();
 }