Re: [Cppcms-users] Fw: Unmount asynchronous application from application pool
Brought to you by:
artyom-beilis
|
From: DieterM75 . <die...@gm...> - 2013-11-19 21:02:00
|
Thanks, after reading some notes about signals and combining it with your snippets, it seems to work now. Would be grateful to get an opinion on the code from you ( http://pastie.org/8493685). Sincerely Dieter On Tue, Nov 19, 2013 at 9:13 AM, Artyom Beilis <art...@ya...> wrote: > > On Tuesday, November 19, 2013 10:05 AM, Artyom Beilis < > art...@ya...> wrote: > > What handler to be called? > > I assume you are working on linux. If you want to reload the > application/system per SIGHUP you need > create appropriate singal handler. Signals are not just callbacks, they > are very different. They do stuff differently. > > Also I'm not even sure about what are you trying to do. > > See this is the original code: > > while(1) { > cppcms::service srv(...) > srv.run(); > if(got_sighup) { > got_sighup = false; > continue; > } > break; > } > > > Now lets say you want to add an async application: > > while(1) { > booster::intrusive_ptr<myapp> p(new myapp) > cppcms::service srv(...) > srv.mount(p,...) > srv.run(); > p = 0; // reset there... > if(got_sighup) { > got_sighup = false; > continue; > } > break; > } > > Thats it... How hard can it be? > > Artyom Beilis > -------------- > CppCMS - C++ Web Framework: http://cppcms.com/ > CppDB - C++ SQL Connectivity: http://cppcms.com > /sql/cppdb/ > > > On Monday, November 18, 2013 11:45 PM, DieterM75 . <die...@gm...> > wrote: > > > Thanks for your answers, I appreciate it! > > If you believe it or not, I have read every single page on the wiki and > tried to understand the application pool and the service class. The thing > is, most of it is written very minimalistic. And I can understand it, time > is valuable. I am writing managed code for a living and I also want to > learn, try things out and in the end understand the framework, but I sure > get stuck without some input. > > For instance the handler code on page "Reload the application" cannot > compile, because no return type is specified. Furthermore I had a look > inside the application base class and there is no potential handler method > that could be overridden. So how is it supposed to get called? > > Sincerely > > > On Mon, Nov 18, 2013 at 10:04 PM, Artyom Beilis <art...@ya...>wrote: > > > Well thanks for the really helpful reply (not). > > First of all, instead of being sarcastic I'd suggest you to read... manual > pages about signal handling and understand how the code in wiki works and > why, also read about cppcms::service::shutdown, read about the event loop > in the wiki and so on. > > As I told you, your pattern is wrong, you should be based on the pattern > in wiki. > > What is wrong: > > - wrong signal handler > - wrong exception implementation > - wrong assumption about how exceptions are handled... etc > > Instead reinventing the wheel, do as I told you in the previous mails, all > you need to reset the application pointer when the srv.run() exits, before > you restart the service. > > > > > ------------------------------------------------------------------------------ > Shape the Mobile Experience: Free Subscription > Software experts and developers: Be at the forefront of tech innovation. > Intel(R) Software Adrenaline delivers strategic insight and game-changing > conversations that shape the rapidly evolving mobile landscape. Sign up > now. > http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > ------------------------------------------------------------------------------ > Shape the Mobile Experience: Free Subscription > Software experts and developers: Be at the forefront of tech innovation. > Intel(R) Software Adrenaline delivers strategic insight and game-changing > conversations that shape the rapidly evolving mobile landscape. Sign up > now. > http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk > > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > > > > > ------------------------------------------------------------------------------ > Shape the Mobile Experience: Free Subscription > Software experts and developers: Be at the forefront of tech innovation. > Intel(R) Software Adrenaline delivers strategic insight and game-changing > conversations that shape the rapidly evolving mobile landscape. Sign up > now. > http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk > _______________________________________________ > Cppcms-users mailing list > Cpp...@li... > https://lists.sourceforge.net/lists/listinfo/cppcms-users > > |