1Net::DBus::Callback(3)User Contributed Perl DocumentationNet::DBus::Callback(3)
2
3
4

NAME

6       Net::DBus::Callback - a callback for receiving reactor events
7

SYNOPSIS

9         use Net::DBus::Callback;
10
11         # Assume we have a 'terminal' object and its got a method
12         # to be invoked everytime there is input on its terminal.
13         #
14         # To create a callback to invoke this method one might use
15         my $cb = Net::DBus::Callback->new(object => $terminal,
16                                           method => "handle_stdio");
17
18         # Whatever is monitoring the stdio channel, would then
19         # invoke the callback, perhaps passing in a parameter with
20         # some 'interesting' data, such as number of bytes available
21         $cb->invoke($nbytes)
22
23         #... which results in a call to
24         #  $terminal->handle_stdio($nbytes)
25

DESCRIPTION

27       This module provides a simple container for storing details about a
28       callback to be invoked at a later date. It is used when registering to
29       receive events from the Net::DBus::Reactor class
30

METHODS

32       my $cb = Net::DBus::Callback->new(method => $name, [args => \@args])
33           Creates a new callback object, for invoking a plain old function.
34           The "method" parameter should be the fully qualified function name
35           to invoke, including the package name. The optional "args" parame‐
36           ter is an array reference of parameters to be pass to the callback,
37           in addition to those passed into the "invoke" method.
38
39       my $cb = Net::DBus::Callback->new(object => $object, method => $name,
40       [args => \@args])
41           Creates a new callback object, for invoking a method on an object.
42           The "method" parameter should be the name of the method to invoke,
43           while the "object" parameter should be a blessed object on which
44           the method will be invoked. The optional "args" parameter is an
45           array reference of parameters to be pass to the callback, in addi‐
46           tion to those passed into the "invoke" method.
47
48       $cb->invoke(@args)
49           Invokes the callback. The argument list passed to the callback is a
50           combination of the arguments supplied in the callback constructor,
51           followed by the arguments supplied in the "invoke" method.
52

AUTHOR

54       Daniel P. Berrange.
55
57       Copyright (C) 2004-2006 Daniel P. Berrange
58

SEE ALSO

60       Net::DBus::Reactor
61
62
63
64perl v5.8.8                       2008-02-20            Net::DBus::Callback(3)
Impressum