.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Net::DBus::ASyncReply 3pm" .TH Net::DBus::ASyncReply 3pm "2020-11-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Net::DBus::ASyncReply \- asynchronous method reply handler .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::DBus::Annotation qw(:call); \& \& my $object = $service\->get_object("/org/example/systemMonitor"); \& \& # List processes & get on with other work until \& # the list is returned. \& my $asyncreply = $object\->list_processes(dbus_call_async, "someuser"); \& \& while (!$asyncreply\->is_ready) { \& ... do some background work.. \& } \& \& my $processes = $asyncreply\->get_result; .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This object provides a handler for receiving asynchronous method replies. An asynchronous reply object is generated when making remote method call with the \f(CW\*(C`dbus_call_async\*(C'\fR annotation set. .SH "METHODS" .IX Header "METHODS" .ie n .IP "$asyncreply\->discard_result;" 4 .el .IP "\f(CW$asyncreply\fR\->discard_result;" 4 .IX Item "$asyncreply->discard_result;" Indicates that the caller is no longer interested in receiving the reply & that it should be discarded. After calling this method, this object should not be used again. .ie n .IP "$asyncreply\->wait_for_result;" 4 .el .IP "\f(CW$asyncreply\fR\->wait_for_result;" 4 .IX Item "$asyncreply->wait_for_result;" Blocks the caller waiting for completion of the of the asynchronous reply. Upon returning from this method, the result can be obtained with the \f(CW\*(C`get_result\*(C'\fR method. .ie n .IP "my $boolean = $asyncreply\->is_ready;" 4 .el .IP "my \f(CW$boolean\fR = \f(CW$asyncreply\fR\->is_ready;" 4 .IX Item "my $boolean = $asyncreply->is_ready;" 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 \f(CW\*(C`get_result\*(C'\fR method. .ie n .IP "$asyncreply\->set_notify($coderef);" 4 .el .IP "\f(CW$asyncreply\fR\->set_notify($coderef);" 4 .IX Item "$asyncreply->set_notify($coderef);" 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. .ie n .IP "my @data = $asyncreply\->get_result;" 4 .el .IP "my \f(CW@data\fR = \f(CW$asyncreply\fR\->get_result;" 4 .IX Item "my @data = $asyncreply->get_result;" 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 \f(CW\*(C`is_ready\*(C'\fR method returning a true value. After calling this method, this object should no longer be used. .SH "AUTHOR" .IX Header "AUTHOR" Daniel Berrange .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copright (C) 2006\-2011, Daniel Berrange. .SH "SEE ALSO" .IX Header "SEE ALSO" Net::DBus, Net::DBus::RemoteObject, Net::DBus::Annotation