{"id":6936,"date":"2022-12-20T19:34:23","date_gmt":"2022-12-20T22:34:23","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/netdbuscallback-man3\/"},"modified":"2022-12-20T19:34:23","modified_gmt":"2022-12-20T22:34:23","slug":"netdbuscallback-man3","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/netdbuscallback-man3\/","title":{"rendered":"Net::DBus::Callback (man3)"},"content":{"rendered":"<h1 align=\"center\">Net::DBus::Callback<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#METHODS\">METHODS<\/a><br \/> <a href=\"#AUTHOR\">AUTHOR<\/a><br \/> <a href=\"#COPYRIGHT\">COPYRIGHT<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Net::DBus::Callback \u2212 a callback for receiving reactor events<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">use Net::DBus::Callback; <br \/> # Assume we have a &#8216;terminal&#8217; object and its got a method <br \/> # to be invoked every time there is input on its terminal. <br \/> # <br \/> # To create a callback to invoke this method one might use <br \/> my $cb = Net::DBus::Callback\u2212>new(object => $terminal, <br \/> method => &#8220;handle_stdio&#8221;); <br \/> # Whatever is monitoring the stdio channel, would then <br \/> # invoke the callback, perhaps passing in a parameter with <br \/> # some &#8216;interesting&#8217; data, such as number of bytes available <br \/> $cb\u2212>invoke($nbytes) <br \/> #&#8230; which results in a call to <br \/> # $terminal\u2212>handle_stdio($nbytes)<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">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. <small>NB<\/small> 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.<\/p>\n<h2>METHODS <a name=\"METHODS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">my $cb = Net::DBus::Callback\u2212>new(method => $name, [args => @args])<\/p>\n<p style=\"margin-left:17%;\">Creates a new callback object, for invoking a plain old function. The &#8220;method&#8221; parameter should be the fully qualified function name to invoke, including the package name. The optional &#8220;args&#8221; parameter is an array reference of parameters to be pass to the callback, in addition to those passed into the &#8220;invoke&#8221; method.<\/p>\n<p style=\"margin-left:11%;\">my $cb = Net::DBus::Callback\u2212>new(object => $object, method => $name, <br \/> [args => @args])<\/p>\n<p style=\"margin-left:17%;\">Creates a new callback object, for invoking a method on an object. The &#8220;method&#8221; parameter should be the name of the method to invoke, while the &#8220;object&#8221; parameter should be a blessed object on which the method will be invoked. The optional &#8220;args&#8221; parameter is an array reference of parameters to be pass to the callback, in addition to those passed into the &#8220;invoke&#8221; method.<\/p>\n<p style=\"margin-left:11%;\">$cb\u2212>invoke(@args)<\/p>\n<p style=\"margin-left:17%;\">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 &#8220;invoke&#8221; method.<\/p>\n<h2>AUTHOR <a name=\"AUTHOR\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Daniel P. Berrange.<\/p>\n<h2>COPYRIGHT <a name=\"COPYRIGHT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Copyright (C) 2004\u22122011 Daniel P. Berrange<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Net::DBus::Reactor<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  Net::DBus::Callback \u2212 a callback for receiving reactor events <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3007,3292],"class_list":["post-6936","post","type-post","status-publish","format-standard","hentry","category-sin-categoria","tag-man3","tag-netdbuscallback"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6936","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=6936"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/6936\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=6936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=6936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=6936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}