Re: POE::Kernel->stop() will trigger _stop in the next release

Deven Parekh <[email protected]> Tue, 10 Nov 2015 14:12:26 -0600
Newsgroups gmane.comp.lang.perl.poe
Message-ID <CAD-35iJiJQ-rKY_hvAwUeJ1zWkv0gLaSj8gwH=vw6NZ6Y=BbJg@mail.gmail.com>
--047d7b15a65d184b8505243554c4
Content-Type: text/plain; charset=UTF-8

Hello,

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.

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:

  Program => sub {
    # Wipe the existing POE::Kernel clean.
    $poe_kernel->stop();

    # Start a new session, or more.
    POE::Session->create(
      ...
    );

    # Run the new sessions.
    POE::Kernel->run();
  }

I had a program that used the above construct which works fine with

POE  => $VERSION = '1.354';

POE::Wheel::Run => $VERSION = '1.354';


However with

POE => $VERSION = '1.367';
POE::Wheel::Run => $VERSION = '1.367';

It seems calling POE::Kernel->stop(); it stops the POE::Kernel
instance in parent as well.

Just wondering if the above change could be causing this behaviour (?)

Thanks in advance.

Best Regards




On Thu, Oct 30, 2014 at 4:00 PM, Rocco Caputo <[email protected]> wrote:

> Hello, everyone.  I hope you've been well.
>
> 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.
>
> I've already run it past irc.perl.org #poe, and nobody objected.
>
> --
> Rocco Caputo <[email protected]>

--047d7b15a65d184b8505243554c4
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hello,<br><br></div>Is it possible that it breaks the=
 following capability of POE::Wheel::Run<br><h3><a class=3D"" name=3D"Runni=
ng_POE::Kernel_in_the_Child">Running POE::Kernel in the Child</a></h3>

<p>Calling <code>POE::Kernel-&gt;run()</code> in the child process effectiv=
ely resumes the copy of the parent process. This is rarely (if ever) desire=
d.</p>

<p>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&gt;</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"">-&gt;</span><span c=
lass=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"">-&gt;</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"">-&gt;</span><span c=
lass=3D"">run</span><span class=3D"">();</span>
  <span class=3D"">}<br><br></span></pre><pre class=3D""><span class=3D"">I=
 had a program that used the above construct which works fine with<br></spa=
n></pre><pre class=3D""><span class=3D"">POE  =3D&gt; $VERSION =3D &#39;1.3=
54&#39;;<br></span></pre><pre class=3D""><span class=3D"">POE::Wheel::Run =
=3D&gt; $VERSION =3D &#39;1.354&#39;;<br><br><br></span></pre><pre class=3D=
""><span class=3D"">However with <br></span></pre><pre class=3D""><span cla=
ss=3D"">POE =3D&gt; </span><span class=3D"">$VERSION =3D &#39;1.367&#39;;<b=
r></span><span class=3D"">POE::Wheel::Run =3D&gt; $VERSION =3D &#39;1.367&#=
39;;<br><br></span></pre><pre class=3D""><span class=3D"">It seems calling =
POE::Kernel-&gt;stop(); it stops the POE::Kernel instance in parent as well=
.<br><br></span></pre><pre class=3D""><span class=3D"">Just wondering if th=
e above change could be causing this behaviour (?)<br><br></span></pre><pre=
 class=3D""><span class=3D"">Thanks in advance.<br></span></pre><pre class=
=3D""><span class=3D"">Best Regards<br></span></pre><pre class=3D""><span c=
lass=3D""><br></span></pre><br></div><div class=3D"gmail_extra"><br><div cl=
ass=3D"gmail_quote">On Thu, Oct 30, 2014 at 4:00 PM, Rocco Caputo <span dir=
=3D"ltr">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">rcaputo=
@pobox.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, e=
veryone.=C2=A0 I hope you&#39;ve been well.<br>
<br>
It&#39;s come to my attention that POE::Kernel-&gt;stop() isn&#39;t trigger=
ing _stop handlers.=C2=A0 This seems wrong, so I&#39;ve changed it.=C2=A0 I=
 hope it doesn&#39;t break anything, but I&#39;m mentioning it here in case=
 people want to check in advance of a release.<br>
<br>
I&#39;ve already run it past <a href=3D"http://irc.perl.org" rel=3D"norefer=
rer" target=3D"_blank">irc.perl.org</a> #poe, and nobody objected.<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
--<br>
Rocco Caputo &lt;<a href=3D"mailto:[email protected]">[email protected]</a>=
&gt;</font></span></blockquote></div><br></div>

--047d7b15a65d184b8505243554c4--