[Cppcms-users] Communication between synchronous and asynchronous applications
Brought to you by:
artyom-beilis
|
From: CN <cn...@fa...> - 2013-11-22 06:12:15
|
Hello!
Imagine I have both synchronous and asynchronous applications mounted:
int main(int argc,char ** argv)
{
try {
cppcms::service srv(argc,argv);
srv.applications_pool().mount(cppcms::applications_factory<my_hello_world>());
booster::intrusive_ptr<chat> c=new chat(srv);
service.applications_pool().mount(c);
srv.run();
}
catch(std::exception const &e) {
std::cerr<<e.what()<<std::endl;
}
}
Assume that
std::vector<cppcms::json::value> messages_;
in
http://cppcms.com/wikipp/en/page/cppcms_1x_chat_json_rpc
is public.
If I understand the framework correctly, asynchronous applications run
in main thread. Therefore, asynchronous applications are appropriate
candidates to keep cross-application data, messages_ in our example,
that is to be shared by synchronous applications.
I would like to know how to access messages_ kept in chat application
from my_hello_world. I have read both
http://cppcms.com/wikipp/en/page/cppcms_1x_event_loop
and
http://cppcms.com/cppcms_ref/latest/classcppcms_1_1service.html#a29410e26d78c56c3f22389db5828cd0c
but still have no idea how. Helps will be greatly appreciated.
Regards,
CN
--
http://www.fastmail.fm - Or how I learned to stop worrying and
love email again
|