man-pages/man3/Net::DBus::ASyncReply.3pm.html
2021-03-31 01:06:50 +01:00

141 lines
3.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of Net::DBus::ASyncReply</TITLE>
</HEAD><BODY>
<H1>Net::DBus::ASyncReply</H1>
Section: User Contributed Perl Documentation (3pm)<BR>Updated: 2019-12-26<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
Net::DBus::ASyncReply - asynchronous method reply handler
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
use Net::DBus::Annotation qw(:call);
my $object = $service-&gt;get_object(&quot;/org/example/systemMonitor&quot;);
# List processes &amp; get on with other work until
# the list is returned.
my $asyncreply = $object-&gt;list_processes(dbus_call_async, &quot;someuser&quot;);
while (!$asyncreply-&gt;is_ready) {
... do some background work..
}
my $processes = $asyncreply-&gt;get_result;
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
This object provides a handler for receiving asynchronous
method replies. An asynchronous reply object is generated
when making remote method call with the <TT>&quot;dbus_call_async&quot;</TT>
annotation set.
<A NAME="lbAE">&nbsp;</A>
<H2>METHODS</H2>
<DL COMPACT>
<DT id="1">$asyncreply-&gt;discard_result;<DD>
Indicates that the caller is no longer interested in
receiving the reply &amp; that it should be discarded. After
calling this method, this object should not be used again.
<DT id="2">$asyncreply-&gt;wait_for_result;<DD>
Blocks the caller waiting for completion of the of the
asynchronous reply. Upon returning from this method, the
result can be obtained with the <TT>&quot;get_result&quot;</TT> method.
<DT id="3">my $boolean = $asyncreply-&gt;is_ready;<DD>
Returns a true value if the asynchronous reply is now
complete (or a timeout has occurred). When this method
returns true, the result can be obtained with the <TT>&quot;get_result&quot;</TT>
method.
<DT id="4">$asyncreply-&gt;set_notify($coderef);<DD>
Sets a notify function which will be invoked when the
asynchronous reply finally completes. The callback will
be invoked with a single parameter which is this object.
<DT id="5">my @data = $asyncreply-&gt;get_result;<DD>
Retrieves the data associated with the asynchronous reply.
If a timeout occurred, then this method will throw an
exception. This method can only be called once the reply
is complete, as indicated by the <TT>&quot;is_ready&quot;</TT> method
returning a true value. After calling this method, this
object should no longer be used.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>AUTHOR</H2>
Daniel Berrange &lt;<A HREF="mailto:dan@berrange.com">dan@berrange.com</A>&gt;
<A NAME="lbAG">&nbsp;</A>
<H2>COPYRIGHT</H2>
Copright (C) 2006-2011, Daniel Berrange.
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
Net::DBus, Net::DBus::RemoteObject, Net::DBus::Annotation
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="9"><A HREF="#lbAE">METHODS</A><DD>
<DT id="10"><A HREF="#lbAF">AUTHOR</A><DD>
<DT id="11"><A HREF="#lbAG">COPYRIGHT</A><DD>
<DT id="12"><A HREF="#lbAH">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:48 GMT, March 31, 2021
</BODY>
</HTML>