132 lines
3.6 KiB
HTML
132 lines
3.6 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Net::DBus::Callback</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Net::DBus::Callback</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"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Net::DBus::Callback - a callback for receiving reactor events
|
|
<A NAME="lbAC"> </A>
|
|
<H2>SYNOPSIS</H2>
|
|
|
|
|
|
|
|
|
|
|
|
<PRE>
|
|
use Net::DBus::Callback;
|
|
|
|
# Assume we have a 'terminal' object and its got a method
|
|
# to be invoked every time 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 'interesting' data, such as number of bytes available
|
|
$cb->invoke($nbytes)
|
|
|
|
#... which results in a call to
|
|
# $terminal->handle_stdio($nbytes)
|
|
|
|
</PRE>
|
|
|
|
|
|
<A NAME="lbAD"> </A>
|
|
<H2>DESCRIPTION</H2>
|
|
|
|
|
|
|
|
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. <FONT SIZE="-1">NB</FONT> 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.
|
|
<A NAME="lbAE"> </A>
|
|
<H2>METHODS</H2>
|
|
|
|
|
|
|
|
<DL COMPACT>
|
|
<DT id="1">my $cb = Net::DBus::Callback->new(method => $name, [args => \@args])<DD>
|
|
|
|
|
|
|
|
|
|
Creates a new callback object, for invoking a plain old function. The <TT>"method"</TT>
|
|
parameter should be the fully qualified function name to invoke, including the
|
|
package name. The optional <TT>"args"</TT> parameter is an array reference of parameters
|
|
to be pass to the callback, in addition to those passed into the <TT>"invoke"</TT> method.
|
|
<DT id="2">my $cb = Net::DBus::Callback->new(object => $object, method => $name, [args => \@args])<DD>
|
|
|
|
|
|
|
|
|
|
Creates a new callback object, for invoking a method on an object. The <TT>"method"</TT>
|
|
parameter should be the name of the method to invoke, while the <TT>"object"</TT> parameter
|
|
should be a blessed object on which the method will be invoked. The optional <TT>"args"</TT>
|
|
parameter is an array reference of parameters to be pass to the callback, in addition
|
|
to those passed into the <TT>"invoke"</TT> method.
|
|
<DT id="3">$cb->invoke(@args)<DD>
|
|
|
|
|
|
|
|
|
|
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 <TT>"invoke"</TT>
|
|
method.
|
|
</DL>
|
|
<A NAME="lbAF"> </A>
|
|
<H2>AUTHOR</H2>
|
|
|
|
|
|
|
|
Daniel P. Berrange.
|
|
<A NAME="lbAG"> </A>
|
|
<H2>COPYRIGHT</H2>
|
|
|
|
|
|
|
|
Copyright (C) 2004-2011 Daniel P. Berrange
|
|
<A NAME="lbAH"> </A>
|
|
<H2>SEE ALSO</H2>
|
|
|
|
|
|
|
|
Net::DBus::Reactor
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="4"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="5"><A HREF="#lbAC">SYNOPSIS</A><DD>
|
|
<DT id="6"><A HREF="#lbAD">DESCRIPTION</A><DD>
|
|
<DT id="7"><A HREF="#lbAE">METHODS</A><DD>
|
|
<DT id="8"><A HREF="#lbAF">AUTHOR</A><DD>
|
|
<DT id="9"><A HREF="#lbAG">COPYRIGHT</A><DD>
|
|
<DT id="10"><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:49 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|