Пример #1
0
int SFDBWorker::svc(void)
{
	m_threadID = ACE_Thread::self();
	

	//BOOL bResult = m_pDatabase->Initialize();

	while (this->m_pManager->done() != true)
	{
		ACE_Time_Value Interval(5);
		Interval += ACE_OS::time(0);

		ACE_Method_Request* pReq = this->m_queue.dequeue(&Interval);
		
		if(NULL == pReq)
		{	
			continue;
		}

		int result = pReq->call();

		if(result == -1)
			break;

		this->m_pManager->return_to_work(this, pReq);
	}

	return 0;
}
Пример #2
0
  virtual int svc (void)
  {
    thread_id_ = ACE_Thread::self ();
    while (1)
      {
        ACE_Method_Request *request = this->queue_.dequeue();
        if (request == 0)
          return -1;

        // Invoke the request
        int result = request->call ();
        if (result == -1)
          break;

        // Return to work.
        this->manager_->return_to_work (this);
      }

    return 0;
  }
Пример #3
0
int DelayExecutor::svc()
{
    if (pre_svc_hook_)
        pre_svc_hook_->call();

    for (;;)
    {
        ACE_Method_Request* rq = queue_.dequeue();

        if (!rq)
            break;

        rq->call();
        delete rq;
    }

    if (post_svc_hook_)
        post_svc_hook_->call();

    return 0;
}
Пример #4
0
int DelayExecutor::svc()
{
    if (pre_svc_hook_)
        pre_svc_hook_->call();

    for (;;)
    {
        ACE_Time_Value timeout = ACE_OS::gettimeofday();
        timeout += FLUSH_TIMEOUT;
        ACE_Method_Request* rq = queue_.dequeue(&timeout);

        if (!rq)
            break;

        rq->call();
        delete rq;
    }

    if (post_svc_hook_)
        post_svc_hook_->call();

    return 0;
}