public JobMessage(IJobContext jobContext) : base(jobContext, JOB_TYPE.MESSAGE) { //this.Messages = new QueueThreadSafe<Message>(); //this.ResponseIds = new QueueThreadSafe<Guid>(); //this.ResponseMessages = new DictionaryThreadSafe<Guid, Message>(); //this.RequestMessageGroup = new DictionaryThreadSafe<Guid, List<Guid>>(); //this.RequestMessageGroupTotal = new DictionaryThreadSafe<Guid, int>(); this.MessagesRequest = new DictionaryThreadSafe <Guid, Message>(); this.MessagesRequestTimeOutExpire = new ListThreadSafe <Guid>(); this.MessagesRequestTimeOut = new ListDoubleThreadSafe <long, Guid>(); this.timer = new System.Threading.Timer(new System.Threading.TimerCallback((obj) => { if (this.MessagesRequestTimeOut.Count == 0) { return; } long timeStart = DateTime.Now.Ticks / 1000; Guid[] ids = this.MessagesRequestTimeOut.FindItem1LessThanAndRemove(FUNC_TIME_OUT_FILTER, timeStart); if (ids.Length > 0) { foreach (var t in ids) { Tracer.WriteLine("RESPONSE TIME_OUT: {0}", t); } this.MessagesRequestTimeOutExpire.AddRange(ids); } }), null, 100, 100); }
public JobSpeechEN(IJobStore _store) { this.StoreJob = _store; this.queue = new QueueThreadSafe <string>(); this.storeUrl = new DictionaryThreadSafe <string, string>(); this.storePath = new DictionaryThreadSafe <string, string>(); }
public JobStore() { #region [ JOB ] jobEvents = new DictionaryThreadSafe <int, AutoResetEvent>(); jobInfos = new DictionaryThreadSafe <int, JobInfo>(); jobGroups = new DictionaryThreadSafe <string, ListThreadSafe <int> >(); listIdsStop = new ListThreadSafe <int>(); #endregion #region [ MESSAGE ] msgCacheData = new DictionaryThreadSafe <Guid, object>(); msgCache = new DictionaryThreadSafe <Guid, Message>(); msgInfo = new JobInfo(new JobMessage(this), new AutoResetEvent(false)); f_addGroupJobName(msgInfo.f_getJob()); #endregion #region [ FORM ] storeForms = new DictionaryThreadSafe <int, IFORM>(); #endregion #region [ URL ] urlFail = new DictionaryThreadSafe <string, string>(); urlOk = new DictionaryThreadSafe <string, string>(); urlPending = new ListThreadSafe <string>(); urlAll = new ListThreadSafe <string>(); f_url_Init(); #endregion f_addJob(new JobLink(this)); }
public JobFactory(JOB_TYPE type) { this.Messages = new QueueThreadSafe <Message>(); this.Type = type; JobHandles = new DictionaryThreadSafe <int, IJobHandle>(); }
public JobLink(IJobStore _store) { this.StoreJob = _store; list = new ListThreadSafe <oLink>(); msg = new QueueThreadSafe <Message>(); urlData = new DictionaryThreadSafe <string, string>(); }
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; }
public JobLink(IJobAction jobAction) : base(JOB_TYPE.LINK, jobAction) { list = new ListThreadSafe <oLink>(); msg = new QueueThreadSafe <Message>(); urlData = new DictionaryThreadSafe <string, string>(); }