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
19         # Whatever is monitoring the stdio channel, would then
20         # invoke the callback, perhaps passing in a parameter with
21         # some 'interesting' data, such as number of bytes available
22         $cb->invoke($nbytes)
23
24         #... which results in a call to
25         #  $terminal->handle_stdio($nbytes)
26

DESCRIPTION

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

METHODS

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

AUTHOR

55       Daniel P. Berrange.
56
58       Copyright (C) 2004-2006 Daniel P. Berrange
59

SEE ALSO

61       Net::DBus::Reactor
62
63
64
65perl v5.12.0                      2008-02-21            Net::DBus::Callback(3)
Impressum