Re: POE::Kernel->stop() will trigger _stop in the next release
[email protected] (Rocco Caputo) Tue, 10 Nov 2015 15:53:55 -0500
| Newsgroups | perl.poe |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_05BD1941-5E49-4D56-9BFC-28027CE0A11F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii I don't expect the change to cause the behavior you've reported. If you can reduce your program to a self-contained test case, something = I can run myself using only easily installed, public dependencies, I can = investigate what happened. --=20 Rocco Caputo <[email protected]> > On Nov 10, 2015, at 15:12, Deven Parekh <[email protected]> = wrote: >=20 > Hello, >=20 > Is it possible that it breaks the following capability of = POE::Wheel::Run > Running POE::Kernel in the Child <> > Calling POE::Kernel->run() in the child process effectively resumes = the copy of the parent process. This is rarely (if ever) desired. >=20 > More commonly, an application wants to run an entirely new POE::Kernel = instance in the child process. This is supported by first stop()ping the = copied instance, starting one or more new sessions, and calling run() = again. For example: >=20 > Program =3D> sub { > # Wipe the existing POE::Kernel clean. > $poe_kernel->stop(); >=20 > # Start a new session, or more. > POE::Session->create( > ... > ); >=20 > # Run the new sessions. > POE::Kernel->run(); > } >=20 > I had a program that used the above construct which works fine with > POE =3D> $VERSION =3D '1.354'; > POE::Wheel::Run =3D> $VERSION =3D '1.354'; >=20 >=20 > However with=20 > POE =3D> $VERSION =3D '1.367'; > POE::Wheel::Run =3D> $VERSION =3D '1.367'; >=20 > It seems calling POE::Kernel->stop(); it stops the POE::Kernel = instance in parent as well. >=20 > Just wondering if the above change could be causing this behaviour (?) >=20 > Thanks in advance. > Best Regards >=20 >=20 >=20 > On Thu, Oct 30, 2014 at 4:00 PM, Rocco Caputo <[email protected] = <mailto:[email protected]>> wrote: > Hello, everyone. I hope you've been well. >=20 > It's come to my attention that POE::Kernel->stop() isn't triggering = _stop handlers. This seems wrong, so I've changed it. I hope it = doesn't break anything, but I'm mentioning it here in case people want = to check in advance of a release. >=20 > I've already run it past irc.perl.org <http://irc.perl.org/> #poe, and = nobody objected. >=20 > -- > Rocco Caputo <[email protected] <mailto:[email protected]>> >=20 --Apple-Mail=_05BD1941-5E49-4D56-9BFC-28027CE0A11F Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" = class=3D""><div class=3D"">I don't expect the change to cause the = behavior you've reported.</div><div class=3D""><br class=3D""></div><div = class=3D"">If you can reduce your program to a self-contained test case, = something I can run myself using only easily installed, public = dependencies, I can investigate what happened.</div><div class=3D""><br = class=3D""><div apple-content-edited=3D"true" class=3D""> <span class=3D"Apple-style-span" style=3D"border-collapse: separate; = color: rgb(0, 0, 0); font-family: Monaco; font-style: normal; = font-variant: normal; font-weight: normal; letter-spacing: normal; = line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; = text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; = -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: = 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: = auto; -webkit-text-stroke-width: 0px; "><div = class=3D"">-- </div><div class=3D"">Rocco Caputo <<a = href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>></div></span> </div> <br class=3D""><div><blockquote type=3D"cite" class=3D""><div = class=3D"">On Nov 10, 2015, at 15:12, Deven Parekh <<a = href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""><meta = http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8" = class=3D""><div dir=3D"ltr" class=3D""><div class=3D"">Hello,<br = class=3D""><br class=3D""></div>Is it possible that it breaks the = following capability of POE::Wheel::Run<br class=3D""><h3 class=3D""><a = class=3D"" name=3D"Running_POE::Kernel_in_the_Child">Running POE::Kernel = in the Child</a></h3><p class=3D"">Calling <code = class=3D"">POE::Kernel->run()</code> in the child process effectively = resumes the copy of the parent process. This is rarely (if ever) = desired.</p><p class=3D"">More commonly, an application wants to run an = entirely new=20 POE::Kernel instance in the child process. This is supported by first=20 stop()ping the copied instance, starting one or more new sessions, and=20= calling run() again. For example:</p> <pre class=3D""> Program <span class=3D"">=3D></span> <span = class=3D"">sub</span> <span class=3D"">{</span> <span class=3D""># Wipe the existing POE::Kernel clean.</span> <span class=3D"">$poe_kernel</span><span class=3D"">-></span><span = class=3D"">stop</span><span class=3D"">();</span> <span class=3D""># Start a new session, or more.</span> POE<span class=3D"">::</span>Session<span class=3D"">-></span><span= class=3D"">create</span><span class=3D"">(</span> <span class=3D"">...</span> <span class=3D"">);</span> <span class=3D""># Run the new sessions.</span> POE<span class=3D"">::</span>Kernel<span class=3D"">-></span><span = class=3D"">run</span><span class=3D"">();</span> <span class=3D"">}<br class=3D""><br class=3D""></span></pre><pre = class=3D""><span class=3D"">I had a program that used the above = construct which works fine with<br class=3D""></span></pre><pre = class=3D""><span class=3D"">POE =3D> $VERSION =3D '1.354';<br = class=3D""></span></pre><pre class=3D""><span class=3D"">POE::Wheel::Run = =3D> $VERSION =3D '1.354';<br class=3D""><br class=3D""><br = class=3D""></span></pre><pre class=3D""><span class=3D"">However with = <br class=3D""></span></pre><pre class=3D""><span class=3D"">POE =3D> = </span><span class=3D"">$VERSION =3D '1.367';<br class=3D""></span><span = class=3D"">POE::Wheel::Run =3D> $VERSION =3D '1.367';<br class=3D""><br= class=3D""></span></pre><pre class=3D""><span class=3D"">It seems = calling POE::Kernel->stop(); it stops the POE::Kernel instance in = parent as well.<br class=3D""><br class=3D""></span></pre><pre = class=3D""><span class=3D"">Just wondering if the above change could be = causing this behaviour (?)<br class=3D""><br class=3D""></span></pre><pre = class=3D""><span class=3D"">Thanks in advance.<br = class=3D""></span></pre><pre class=3D""><span class=3D"">Best Regards<br = class=3D""></span></pre><pre class=3D""><span class=3D""><br = class=3D""></span></pre><br class=3D""></div><div = class=3D"gmail_extra"><br class=3D""><div class=3D"gmail_quote">On Thu, = Oct 30, 2014 at 4:00 PM, Rocco Caputo <span dir=3D"ltr" class=3D""><<a = href=3D"mailto:[email protected]" target=3D"_blank" = class=3D"">[email protected]</a>></span> wrote:<br = class=3D""><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 = .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, everyone. = I hope you've been well.<br class=3D""> <br class=3D""> It's come to my attention that POE::Kernel->stop() isn't triggering = _stop handlers. This seems wrong, so I've changed it. I hope = it doesn't break anything, but I'm mentioning it here in case people = want to check in advance of a release.<br class=3D""> <br class=3D""> I've already run it past <a href=3D"http://irc.perl.org/" = rel=3D"noreferrer" target=3D"_blank" class=3D"">irc.perl.org</a> #poe, = and nobody objected.<br class=3D""> <span class=3D"HOEnZb"><font color=3D"#888888" class=3D""><br class=3D""> --<br class=3D""> Rocco Caputo <<a href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>></font></span></blockquote></div><br = class=3D""></div> </div></blockquote></div><br class=3D""></div></body></html>= --Apple-Mail=_05BD1941-5E49-4D56-9BFC-28027CE0A11F--