.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" 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 .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "Net::DBus::Callback 3pm" .TH Net::DBus::Callback 3pm "2016-07-08" "perl v5.24.1" "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::Callback \- a callback for receiving reactor events .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use Net::DBus::Callback; \& \& # Assume we have a \*(Aqterminal\*(Aq object and its got a method \& # to be invoked everytime there is input on its terminal. \& # \& # To create a callback to invoke this method one might use \& my $cb = Net::DBus::Callback\->new(object => $terminal, \& method => "handle_stdio"); \& \& \& # Whatever is monitoring the stdio channel, would then \& # invoke the callback, perhaps passing in a parameter with \& # some \*(Aqinteresting\*(Aq data, such as number of bytes available \& $cb\->invoke($nbytes) \& \& #... which results in a call to \& # $terminal\->handle_stdio($nbytes) .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module provides a simple container for storing details about a callback to be invoked at a later date. It is used when registering to receive events from the Net::DBus::Reactor class. \s-1NB\s0 use of this module in application code is no longer necessary and it remains purely for backwards compatibility. Instead you can simply pass a subroutine code reference in any place where a callback is desired. .SH "METHODS" .IX Header "METHODS" .ie n .IP "my $cb = Net::DBus::Callback\->new(method => $name, [args => \e@args])" 4 .el .IP "my \f(CW$cb\fR = Net::DBus::Callback\->new(method => \f(CW$name\fR, [args => \e@args])" 4 .IX Item "my $cb = Net::DBus::Callback->new(method => $name, [args => @args])" Creates a new callback object, for invoking a plain old function. The \f(CW\*(C`method\*(C'\fR parameter should be the fully qualified function name to invoke, including the package name. The optional \f(CW\*(C`args\*(C'\fR parameter is an array reference of parameters to be pass to the callback, in addition to those passed into the \f(CW\*(C`invoke\*(C'\fR method. .ie n .IP "my $cb = Net::DBus::Callback\->new(object => $object, method => $name, [args => \e@args])" 4 .el .IP "my \f(CW$cb\fR = Net::DBus::Callback\->new(object => \f(CW$object\fR, method => \f(CW$name\fR, [args => \e@args])" 4 .IX Item "my $cb = Net::DBus::Callback->new(object => $object, method => $name, [args => @args])" Creates a new callback object, for invoking a method on an object. The \f(CW\*(C`method\*(C'\fR parameter should be the name of the method to invoke, while the \f(CW\*(C`object\*(C'\fR parameter should be a blessed object on which the method will be invoked. The optional \f(CW\*(C`args\*(C'\fR parameter is an array reference of parameters to be pass to the callback, in addition to those passed into the \f(CW\*(C`invoke\*(C'\fR method. .ie n .IP "$cb\->invoke(@args)" 4 .el .IP "\f(CW$cb\fR\->invoke(@args)" 4 .IX Item "$cb->invoke(@args)" Invokes the callback. The argument list passed to the callback is a combination of the arguments supplied in the callback constructor, followed by the arguments supplied in the \f(CW\*(C`invoke\*(C'\fR method. .SH "AUTHOR" .IX Header "AUTHOR" Daniel P. Berrange. .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (C) 2004\-2011 Daniel P. Berrange .SH "SEE ALSO" .IX Header "SEE ALSO" Net::DBus::Reactor