[3704] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

Re: [barnowl] barnowl-screen (#101)

daemon@ATHENA.MIT.EDU (Jason Gross)
Tue Jan 7 19:45:23 2014

Date: Tue, 07 Jan 2014 16:45:20 -0800
From: Jason Gross <notifications@github.com>
Reply-To: barnowl/barnowl <reply+p-8712663-29d53b8c7f5f6c2aae209f4cc44199b43f8778fb-4475081@reply.github.com>
To: barnowl/barnowl <barnowl@noreply.github.com>
In-Reply-To: <barnowl/barnowl/pull/101@github.com>


----==_mimepart_52cc9fa098023_2929579cfc33751b
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

> +
> +    $hdlerr = new AnyEvent::Handle(fh => $stderr);
> +    $hdlin = new AnyEvent::Handle(fh => $stdin);
> +
> +    my $output = "";
> +
> +    $hdlin->push_write($password .  "\n");
> +    $hdlerr->push_read (line => sub {
> +        my ($hdl, $line) = @_;
> +        $output .= $line;
> +                     });
> +    close $stdout;
> +    $w = AnyEvent->child (pid => $pid, cb => sub {
> +        my ($pid, $status) = @_;
> +        if ($status != 0){
> +            BarnOwl::error($output);

Can `BarnOwl::error` be called successfully from inside a child process/thread?  I know the logging code has to do some juggling to report errors, involving posting messages back to the main task.  Does this just magically work in perl?

---
Reply to this email directly or view it on GitHub:
https://github.com/barnowl/barnowl/pull/101/files#r8712663
----==_mimepart_52cc9fa098023_2929579cfc33751b
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<p>In perl/modules/Kerberos/lib/BarnOwl/Module/Kerberos.pm:</p>
<pre style='color:#555'>&gt; +
&gt; +    $hdlerr = new AnyEvent::Handle(fh =&gt; $stderr);
&gt; +    $hdlin = new AnyEvent::Handle(fh =&gt; $stdin);
&gt; +
&gt; +    my $output = &quot;&quot;;
&gt; +
&gt; +    $hdlin-&gt;push_write($password .  &quot;\n&quot;);
&gt; +    $hdlerr-&gt;push_read (line =&gt; sub {
&gt; +        my ($hdl, $line) = @_;
&gt; +        $output .= $line;
&gt; +                     });
&gt; +    close $stdout;
&gt; +    $w = AnyEvent-&gt;child (pid =&gt; $pid, cb =&gt; sub {
&gt; +        my ($pid, $status) = @_;
&gt; +        if ($status != 0){
&gt; +            BarnOwl::error($output);
</pre>
<p>Can <code>BarnOwl::error</code> be called successfully from inside a child process/thread?  I know the logging code has to do some juggling to report errors, involving posting messages back to the main task.  Does this just magically work in perl?</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br>Reply to this email directly or <a href='https://github.com/barnowl/barnowl/pull/101/files#r8712663'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/4475081__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcwNDY3NDcyMCwiZGF0YSI6eyJpZCI6NDEzODA0Nn19--7823d1af0cc142b51b85edcd8576863b22056615.gif' height='1' width='1'></p>
----==_mimepart_52cc9fa098023_2929579cfc33751b--

home help back first fref pref prev next nref lref last post