Exemplo n.º 1
0
        public void PutRecord(IBedRecord record)
        {
            object[] values = new object[record.FieldCount];
            record.GetValues(values);
            IBedRecord input = new ArrayDataRecord(m_putFormat, values);
            IBedRecord trans = m_transform.Transform(input);

            m_queue.Put(new Element {
                Record = trans
            });
        }
Exemplo n.º 2
0
 private static Application WantApp(string appname)
 {
     lock (m_apps)
     {
         if (!m_apps.ContainsKey(appname))
         {
             var app = new Application(appname);
             m_apps[appname] = app;
             if (m_thread == null)
             {
                 m_thread = new Thread(ThreadProc);
                 m_thread.IsBackground = true;
                 m_thread.Start();
             }
             m_downloadQueue.Put(app);
         }
         return(m_apps[appname]);
     }
 }
Exemplo n.º 3
0
        public IAsyncResult BeginInvoke(PriorityLevel priority, bool behaveAsStack, IInvokableAction action, AsyncCallback callback)
        {
            if (m_queue == null)
            {
                throw new InternalError("DAE-00005 Connection queue is NULL, probably connection is not open");
            }
            if (IsInInvokerThread)
            {
                try
                {
                    object res = action.RunProc();
                    return(new ValueAsyncResult(res, null));
                }
                catch (Exception err)
                {
                    return(new ValueAsyncResult(null, err));
                }
                //throw new Exception("Invoke called from the same thread");
            }
            QElement elem = new QElement(this, action, callback, m_thread);

            m_queue.Put(priority, behaveAsStack, elem);
            return(elem);
        }
Exemplo n.º 4
0
 public void QuitLogging()
 {
     m_queue.Put(null);
 }