Net::DB...Callback(3)
π NAME π
okay bestie, welcome to Net::DBus::Callback(3) β the little module from the User Contributed Perl Documentation corner that's literally a callback for receiving reactor events. That's the whole vibe: Net::DBus::Callback = a callback for receiving reactor events. π
πΈ SYNOPSIS πΈ
Here's the group-chat demo, no cap:
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)
π¦ DESCRIPTION π¦
This module is lowkey just a tiny container for storing the deets about a callback you wanna invoke at a later date. It gets used when you're registering to receive events from the Net::DBus::Reactor class.
NB, bestie: using 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. Periodt. β¨
π METHODS π
my $cb = Net::DBus::Callback->new(method => $name, [args => \@args])β makes a new callback object for invoking a plain old function. The"method"parameter should be the fully qualified function name to invoke, including the package name. The optional"args"parameter is an array reference of parameters to be passed to the callback, in addition to those passed into the"invoke"method. π«Άmy $cb = Net::DBus::Callback->new(object => $object, method => $name, [args => \@args])β makes a new callback object for invoking a method on an object. The"method"parameter should be the name of the method to invoke, while the"object"parameter should be a blessed object on which the method will be invoked. The optional"args"parameter is an array reference of parameters to be passed to the callback, in addition to those passed into the"invoke"method. π$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"invoke"method. π₯
π AUTHOR π
Daniel P. Berrange. π
π COPYRIGHT π
Copyright (C) 2004-2011 Daniel P. Berrange
β SEE ALSO β
Net::DBus::Reactor
okay bye bestie, this page was served by perl v5.42.0, dated 2019-12-17 β mwah π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Net-DBus 1.2.0-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: perl-Net-DBus 1.2.0-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: perl-Net-DBus 1.2.0-160000.2.2 Β· GPL-2.0-or-later
- opensuse-leap 16.0: perl-Net-DBus 1.2.0-160000.2.2 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms