Async call from client app

Forum for posting problems using QxOrm library

Async call from client app

Postby nickla » Thu Aug 09, 2012 5:40 pm

How can i use async calls from client app?

I found use of QxDaoAsync in qxServiceServer only.

I want to make calls to server that will not stop execution of client code.
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia

Re: Async call from client app

Postby nickla » Thu Aug 09, 2012 5:45 pm

I found answer in qxClient code.

Code: Select all
void main_dlg::onClickBtnDateTimeAsync()
{
   if (m_pDateTimeAsync) { qDebug("[QxOrm] '%s' transaction is already running", "server_infos::get_current_date_time"); return; }
   // Create service and call method to retrieve current server date-time (async mode)
   server_infos_ptr service = server_infos_ptr(new server_infos());
   m_pDateTimeAsync.reset(new qx::service::QxClientAsync());
   QObject::connect(m_pDateTimeAsync.get(), SIGNAL(finished()), this, SLOT(onDateTimeAsyncFinished()));
   m_pDateTimeAsync->setService(service, "get_current_date_time");
   m_pDateTimeAsync->start();
}


This topic is closed :)
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia

Re: Async call from client app

Postby qxorm » Fri Aug 10, 2012 9:34 am

This topic is closed :)

Cool ;)
The answer is also in the tutorial, here : http://www.qxorm.com/qxorm_en/tutorial_2.html#tuto_302
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 3 guests