<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://alteeve.com/w/index.php?action=history&amp;feed=atom&amp;title=Net%3A%3ADBus%3A%3AASyncReply_Methods</id>
	<title>Net::DBus::ASyncReply Methods - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://alteeve.com/w/index.php?action=history&amp;feed=atom&amp;title=Net%3A%3ADBus%3A%3AASyncReply_Methods"/>
	<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Net::DBus::ASyncReply_Methods&amp;action=history"/>
	<updated>2026-05-09T00:21:31Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://alteeve.com/w/index.php?title=Net::DBus::ASyncReply_Methods&amp;diff=446&amp;oldid=prev</id>
		<title>Digimer: Created page with &#039;{{dbtut_header}}  = discard_result =  Usage: &lt;source lang=&quot;perl&quot;&gt;$asyncreply-&gt;discard_result;&lt;/source&gt;  This tells the program that the caller is no longer interested in any furt…&#039;</title>
		<link rel="alternate" type="text/html" href="https://alteeve.com/w/index.php?title=Net::DBus::ASyncReply_Methods&amp;diff=446&amp;oldid=prev"/>
		<updated>2009-10-12T02:37:45Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;#039;{{dbtut_header}}  = discard_result =  Usage: &amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$asyncreply-&amp;gt;discard_result;&amp;lt;/source&amp;gt;  This tells the program that the caller is no longer interested in any furt…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Páàjì titun&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{dbtut_header}}&lt;br /&gt;
&lt;br /&gt;
= discard_result =&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$asyncreply-&amp;gt;discard_result;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells the program that the caller is no longer interested in any further responses. Once this is called, the associated object should no longer be used.&lt;br /&gt;
&lt;br /&gt;
= wait_for_result =&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$asyncreply-&amp;gt;wait_for_result;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This holds or pauses the caller until the remote method has returned results. Once this returns, you can collect the returned data using the &amp;#039;get_result&amp;#039; method.&lt;br /&gt;
&lt;br /&gt;
= is_ready =&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;my $boolean = $asyncreply-&amp;gt;is_ready;&amp;lt;/source&amp;gt;&lt;br /&gt;
:MADI: Would a good example of this be something like &amp;quot;while (!$asyncreply-&amp;gt;is_ready) { &amp;amp;display_progress_bar; } # Where &amp;#039;display_progress_bar&amp;#039; is some yet-written method...&amp;quot; ?&lt;br /&gt;
&lt;br /&gt;
This returns a boolean value of (TRUE/0??) when the remote method has returned data or timed out. Once true, you can collect the data or error using the &amp;#039;get_result&amp;#039; method.&lt;br /&gt;
&lt;br /&gt;
= set_notify =&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
my $coderef=\&amp;amp;some_method();&lt;br /&gt;
$asyncreply-&amp;gt;set_notify($coderef);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This takes a reference to a method and executes it when the remote method has completed. The referenced method will be called with only a reference to this object.&lt;br /&gt;
&lt;br /&gt;
:MADI: Confirm that I understand this right. If I do, ask Daniel if it would be reasonable/safe/possible to take an array of extra variables that could be passed to the referenced method. Ie:&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
sub set_notify {&lt;br /&gt;
        my $self = shift;&lt;br /&gt;
        my $cb = shift;&lt;br /&gt;
        my @vars = @_;&lt;br /&gt;
&lt;br /&gt;
        $self-&amp;gt;{pending_call}-&amp;gt;set_notify(sub&lt;br /&gt;
        {&lt;br /&gt;
                my $pending_call = shift;&lt;br /&gt;
&lt;br /&gt;
                &amp;amp;$cb($self, @vars);&lt;br /&gt;
        });&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Call with:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;$asyncreply-&amp;gt;set_notify($coderef, $conf, $foo, $bar);&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= get_result =&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;my @data = $asyncreply-&amp;gt;get_result;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This returns the data from the remote method call. If the remote method call timed out, this method will throw an exception. This should only be called after the &amp;#039;is_ready&amp;#039; method returns a true value or the &amp;#039;wait_for_result&amp;#039; method has returned. Once this method is called, this object should no longer be used.&lt;br /&gt;
:MADI: In the case of an exception, could/should a program run this in an &amp;#039;eval&amp;#039;?&lt;br /&gt;
&lt;br /&gt;
{{footer}}&lt;/div&gt;</summary>
		<author><name>Digimer</name></author>
	</entry>
</feed>