Net::DBus::Binding::PendingCall Methods

From AN!Wiki
Jump to: navigation, search

 AN!Tools :: Net::DBus Binding Tutorial :: Net::DBus::Binding::PendingCall Methods

Contents

new

Usage:

my $method_call="";       # Net::DBus::Binding::Message::MethodCall object.
my $pending_call="";      # Raw 'C' Pending Call object.
my $call = Net::DBus::Binding::PendingCall->new(
        method_call  => $method_call,
        pending_call => $pending_call);

This creates a new 'PendingCall' object where '$method_call' is a reference to a 'Net::DBus::Binding::MethodCall' object and '$pending_call' is a reference to the raw C pending call object.

new

Usage:

my $method_call="";       # Net::DBus::Binding::Message::MethodCall object.
my $pending_call="";      # Raw 'C' Pending Call object.
my $call = Net::DBus::Binding::PendingCall->new(
        method_call  => $method_call,
        pending_call => $pending_call);

This creates a new 'PendingCall' object where '$method_call' is a reference to a 'Net::DBus::Binding::MethodCall' object and '$pending_call' is a reference to the raw C pending call object.

cancel

Usage:

$call->cancel;

This cancels the pending call referenced by '$call'. Any reply that may come later will be discarded.

get_completed

Usage:

my $boolean=$call->get_completed;

This checks if the reply (or timeout) has been received by the pending call referenced by '$call', returning '1' if so, '0' otherwise.

block

Usage:

$call->block;

This pauses until a reply (or timeout) has been received by the pending call referenced by '$call'.

get_reply

Usage:

my $message=$call->get_reply;

This reads the returned message once it has been received. This message is an 'Net::DBus::Binding::Message' object associated with the completed '$call' pending call.

set_notify

Usage:

my $coderef=\&some_routine;
$call->set_notify($coderef);

When the message is returned for the '$call' pending call, the code referenced by '$coderef' will be called. The called code will be passed the pending call object '$call' as the sole argument.

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Us: Alteeve's Niche! Support: Mailing List IRC: #clusterlabs on Freenode   © Alteeve's Niche! Inc. 1997-2019
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.
Personal tools
Namespaces

Variants
Actions
Navigation
projects
Toolbox