.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "POE::API::Peek 3pm" .TH POE::API::Peek 3pm "2012-01-11" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" POE::API::Peek \- Peek into the internals of a running POE environment .SH "VERSION" .IX Header "VERSION" version 2.20 .SH "DESCRIPTION" .IX Header "DESCRIPTION" POE::API::Peek extends the POE::Kernel interface to provide clean access to Kernel internals in a cross-version compatible manner. Other calculated data is also available. .PP My intention is to provide massive amounts of internal data for use in \&\s-1POE\s0 debugging. .SH "WARNING" .IX Header "WARNING" \&\fBThis version of this module is certified against \s-1POE\s0 version 1.300 and above. It will fail on any other \s-1POE\s0 version.\fR .PP \&\fBFurther, this module requires perl v5.6.1 or above.\fR .SH "METHODS" .IX Header "METHODS" .SS "new" .IX Subsection "new" .Vb 1 \& my $api = POE::API::Peek\->new(); .Ve .PP Returns a blessed reference. Takes no parameters. .SS "id" .IX Subsection "id" .Vb 1 \& my $foo = $api\->id(); .Ve .PP Obtain the unique id for the kernel. Takes no parameters. Returns a scalar containing a string. .SH "KERNEL UTILITIES" .IX Header "KERNEL UTILITIES" .SS "is_kernel_running" .IX Subsection "is_kernel_running" .Vb 3 \& if($api\->is_kernel_running) { \& # do stuff... \& } .Ve .PP Tell if the \s-1POE\s0 Kernel is running and active. Returns 1 if the Kernel is running and 0 if it is not. .SS "active_event" .IX Subsection "active_event" .Vb 1 \& my $event = $api\->active_event(); .Ve .PP Get the active event name. Returns a string containing the event name. .SS "kernel_memory_size" .IX Subsection "kernel_memory_size" .Vb 1 \& my $size = $api\->kernel_memory_size(); .Ve .PP Get the memory footprint of the kernel and consequently the entire \s-1POE\s0 environment. See the Devel::Size documentation for several caveats involved in this metric. .SS "event_list" .IX Subsection "event_list" .Vb 1 \& my $events = $api\->event_list(); .Ve .PP Gets the list of events for the whole \s-1POE\s0 environment. Returns a hash with the session IDs as the keys and a list of events as the values. .SS "which_loop" .IX Subsection "which_loop" .Vb 1 \& my $loop_name = $api\->which_loop(); .Ve .PP Tell which Loop \s-1POE\s0 has decided to use. Returns the string name of the Loop module. .SH "SESSION UTILITIES" .IX Header "SESSION UTILITIES" .SS "current_session" .IX Subsection "current_session" .Vb 1 \& my $foo = $api\->current_session(); .Ve .PP Get the POE::Session object for the currently active session. Takes no parameters. Returns a scalar containing a reference. .SS "get_session_children" .IX Subsection "get_session_children" .Vb 2 \& my @children = $api\->get_session_children($session_id); \& my @children = $api\->get_session_children(); .Ve .PP Get the children (if any) for a given session. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not provided, the method defaults to the currently active session. Returns a list of POE::Session objects. .SS "is_session_child" .IX Subsection "is_session_child" .Vb 3 \& if($api\->is_session_child($parent, $session_id)) { } \& if($api\->is_session_child($parent, $session)) { } \& if($api\->is_session_child($parent)) { } .Ve .PP Determine if POE::Session A is a child of POE::Session B. Takes one mandatory parameter, a POE::Session object which is the potential parent session this method will interrogate. Takes one optional parameter, a POE::Session object which is the session whose parentage this method will determine. If this parameter is not specified, it will default to the currently active session. Returns a boolean. .SS "get_session_parent" .IX Subsection "get_session_parent" .Vb 3 \& my $parent = $api\->get_session_parent($session_id); \& my $parent = $api\->get_session_parent($session); \& my $parent = $api\->get_session_parent(); .Ve .PP Get the parent for a given session. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not provided, the method defaults to the currently active session. Returns a POE::Session object. .SS "resolve_session_to_ref" .IX Subsection "resolve_session_to_ref" .Vb 2 \& my $session = $api\->resolve_session_to_ref($session_id); \& my $session = $api\->resolve_session_to_ref(); .Ve .PP Obtain a reference to a session given its \s-1ID\s0. Takes one optional parameter, a POE::Session \s-1ID\s0. If this parameter is not specified, it will default to the currently active session. Returns a reference to a POE::Session object on success; undef on failure. .SS "resolve_session_to_id" .IX Subsection "resolve_session_to_id" .Vb 2 \& my $session_id = $api\->resolve_session_to_id($session); \& my $session_id = $api\->resolve_session_to_id(); .Ve .PP Obtain the session id for a given POE::Session object. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not specified, it will default to the currently active session. Returns an integer on success and undef on failure. .SS "get_session_refcount" .IX Subsection "get_session_refcount" .Vb 3 \& my $count = $api\->get_session_refcount($session_id); \& my $count = $api\->get_session_refcount($session); \& my $count = $api\->get_session_refcount(); .Ve .PP Obtain the reference count for a given POE::Session. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not specified, it will default to the currently active session. Returns an integer. .SS "session_count" .IX Subsection "session_count" .Vb 1 \& my $count = $api\->session_count(); .Ve .PP Obtain a count of how many sessions exist. Takes no parameters. Returns an integer. .PP Note: for various reasons, the Kernel counts as a session. .SS "session_list" .IX Subsection "session_list" .Vb 1 \& my @sessions = $api\->session_list(); .Ve .PP Obtain a list of all the sessions that exist. Takes no parameters. Returns a list populated with POE::Session objects. .PP Note: While the Kernel counts as a session, it has been extracted from this list. .SS "session_memory_size" .IX Subsection "session_memory_size" .Vb 3 \& my $size = $api\->session_memory_size(); \& my $size = $api\->session_memory_size($session); \& my $size = $api\->session_memory_size($session_id); .Ve .PP Get the memory footprint of a session. If no session is provided, the current session is used. See the Devel::Size documentation for several caveats involved in this metric. .SS "session_event_list" .IX Subsection "session_event_list" .Vb 6 \& my @events = $api\->session_event_list(); \& my $events = $api\->session_event_list(); \& my @events = $api\->session_event_list($session); \& my $events = $api\->session_event_list($session); \& my @events = $api\->session_event_list($session_id); \& my $events = $api\->session_event_list($session_id); .Ve .PP Get the list of events for a session. If no session is provided, the current session is used. .SH "ALIAS UTILITIES" .IX Header "ALIAS UTILITIES" .SS "resolve_alias" .IX Subsection "resolve_alias" .Vb 1 \& my $session = $api\->resolve_alias($session_alias); .Ve .PP Resolve a session alias into a POE::Session object. Takes one mandatory parameter, a session alias. Returns a POE::Session object on success or undef on failure. .SS "session_alias_list" .IX Subsection "session_alias_list" .Vb 3 \& my @aliases = $api\->session_alias_list($session_id); \& my @aliases = $api\->session_alias_list($session); \& my @aliases = $api\->session_alias_list(); .Ve .PP Obtain a list of aliases for a POE::Session object. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not specified, it will default to the currently active session. Returns a list of strings. .SS "session_alias_count" .IX Subsection "session_alias_count" .Vb 3 \& my $count = $api\->session_alias_count($session_id); \& my $count = $api\->session_alias_count($session); \& my $count = $api\->session_alias_count(); .Ve .PP Obtain the count of how many aliases a session has. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not specified, it will default to the currently active session. Returns an integer. .SS "session_id_loggable" .IX Subsection "session_id_loggable" .Vb 3 \& my $str = $api\->session_id_loggable($session_id); \& my $str = $api\->session_id_loggable($session); \& my $str = $api\->session_id_loggable(); .Ve .PP Obtain a loggable version of a session id. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not specified, it will default to the currently active session. Returns a string. .SH "EVENT UTILITIES" .IX Header "EVENT UTILITIES" # event_count_to {{{ .SS "event_count_to" .IX Subsection "event_count_to" .Vb 3 \& my $count = $api\->event_count_to($session_id); \& my $count = $api\->event_count_to($session); \& my $count = $api\->event_count_to(); .Ve .PP Get the number of events heading toward a particular session. Takes one parameter, a POE::Session object or \s-1ID\s0. if none is provided, defaults to the current session. Returns an integer. .SS "event_count_from" .IX Subsection "event_count_from" .Vb 3 \& my $count = $api\->get_session_extref_count($session_id); \& my $count = $api\->event_count_from($session); \& my $count = $api\->event_count_from(); .Ve .PP Get the number of events heading out from a particular session. Takes one parameter, a POE::Session object or \s-1ID\s0. If none is provided, defaults to the current session. Return an integer. .SS "event_queue" .IX Subsection "event_queue" .Vb 1 \& my $foo = $api\->event_queue(); .Ve .PP Access the internal event queue. Takes no parameters. Returns a scalar containing a reference to a POE::Queue::Array object. .SS "event_queue_dump" .IX Subsection "event_queue_dump" .Vb 1 \& my @queue = $api\->event_queue_dump(); .Ve .PP Dump the contents of the event queue in a nice understandable fashion. Takes no parameters. Returns a list of queue items. Each item is a hash containing the following entries: .IP "\(bu" 4 \&\s-1ID\s0 .Sp The id number that \s-1POE\s0's queue identifies this entry as. .IP "\(bu" 4 index .Sp The index into the POE::Queue::Array which holds this entry. .IP "\(bu" 4 priority .Sp The priority level this entry has. .IP "\(bu" 4 event .Sp The name of this event .IP "\(bu" 4 source .Sp What caused this event. Usually a POE::Session. .IP "\(bu" 4 destination .Sp Where this event is headed. Usually a POE::Session. .IP "\(bu" 4 type .Sp The type of event this is. May have the value User, _start, _stop, _signal, _garbage_collect, _parent, _child, _sigchld_poll, Alarm, File Activity, or Unknown. .SH "EXTREF UTILITIES" .IX Header "EXTREF UTILITIES" .SS "extref_count" .IX Subsection "extref_count" .Vb 1 \& my $count = $api\->extref_count(); .Ve .PP Obtain a count of sessions with extra references. Takes no parameters. Returns an integer. .SS "get_session_extref_count" .IX Subsection "get_session_extref_count" .Vb 3 \& my $count = $api\->get_session_extref_count($session_id); \& my $count = $api\->get_session_extref_count($session); \& my $count = $api\->get_session_extref_count(); .Ve .PP Obtain the number of extra references a session has. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not specified, it will default to the currently active session. Returns an integer. .SH "FILEHANDLE UTILITIES" .IX Header "FILEHANDLE UTILITIES" .SS "is_handle_tracked" .IX Subsection "is_handle_tracked" .Vb 1 \& if($api\->is_handle_tracked($handle, $mode)) { } .Ve .PP Determine if \s-1POE\s0 is tracking a handle. Takes two mandatory parameters, a filehandle and a mode indicator. Returns a boolean. .SS "handle_count" .IX Subsection "handle_count" .Vb 1 \& my $count = $api\->handle_count(); .Ve .PP Obtain a count of how many handles \s-1POE\s0 is tracking. Takes no parameters. Returns an integer. .SS "session_handle_count" .IX Subsection "session_handle_count" .Vb 3 \& my $count = $api\->session_handle_count($session_id); \& my $count = $api\->session_handle_count($session); \& my $count = $api\->session_handle_count(); .Ve .PP Obtain a count of the active handles for a given session. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not supplied, it will default to the currently active session. .SH "PID UTILITIES" .IX Header "PID UTILITIES" .SS "session_pid_count" .IX Subsection "session_pid_count" .Vb 3 \& my $count = $api\->session_pid_count($session_id); \& my $count = $api\->session_pid_count($session); \& my $count = $api\->session_pid_count(); .Ve .PP Obtain a count of the process IDs being watched by a session. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not supplied, it will default to the currently active session. .PP Since 1.350 of \s-1POE\s0 it is no longer possible to query the number of processes a session is watching. This method is deprecated and will be removed in a future version. .SH "SIGNAL UTILITIES" .IX Header "SIGNAL UTILITIES" \&\s-1POTENTIAL\s0 \s-1BREAKAGE\s0 \s-1NOTE:\s0 In \s-1POE\s0 v1.293 (in particular: svn rev 2916) changed the structure of signals. Previously, the data portion of a signal was simply the name of the event to be called. Now it contains a data portion, continuation style arguments that may be passed on to the signal handler. .PP See the POE::Kernel documentation for more info. .SS "get_safe_signals" .IX Subsection "get_safe_signals" .Vb 1 \& my @safe_signals = $api\->get_safe_signals(); .Ve .PP Obtain a list of signals which it is safe for \s-1POE\s0 to manipulate. Takes no parameters. Returns a list of strings. .SS "get_signal_type" .IX Subsection "get_signal_type" .Vb 1 \& my $type = $api\->get_signal_type($signal_name); .Ve .PP Figure out which type of signal this is. Signals can be one of three types, \s-1BENIGN\s0, \s-1TERMINAL\s0, \s-1NONMASKABLE\s0. The type value returned here, corresponds to subroutine constants \s-1SIGTYPE_BENIGN\s0, \s-1SIGTYPE_TERMINAL\s0, and \s-1SIGTYPE_NONMASKABLE\s0 in POE::Kernel's namespace. Takes one mandatory parameter, a signal name. .SS "is_signal_watched" .IX Subsection "is_signal_watched" .Vb 1 \& if($api\->is_signal_watched($signal_name)) { } .Ve .PP Determine if a signal is being explicitly watched. Takes one mandatory parameter, a signal name. Returns a boolean. .SS "signals_watched_by_session" .IX Subsection "signals_watched_by_session" .Vb 2 \& my %signals = $api\->signals_watched_by_session($session); \& my %signals = $api\->signals_watched_by_session(); .Ve .PP Get the signals watched by a session and the events they generate. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not supplied, it will default to the currently active session. Returns a hash, with a signal name as the key and the event the session generates as the value. .SS "signal_watchers" .IX Subsection "signal_watchers" .Vb 1 \& my %watchers = $api\->signal_watchers($signal_name); .Ve .PP Get a list of the sessions watching a particular signal. Takes one mandatory parameter, a signal name. Returns a hash, keyed by session reference with an event name as the value. .SS "is_signal_watched_by_session" .IX Subsection "is_signal_watched_by_session" .Vb 3 \& if($api\->is_signal_watched_by_session($signal_name, $session_id)) { } \& if($api\->is_signal_watched_by_session($signal_name, $session)) { } \& if($api\->is_signal_watched_by_session($signal_name)) { } .Ve .PP Determine if a given session is explicitly watching a signal. Takes one mandatory parameter, a signal name. Takes one optional parameter, a POE::Session object or \s-1ID\s0. If this parameter is not provided, it will default to the currently active session. Returns a boolean. .SH "AUTHORS" .IX Header "AUTHORS" sungo Yuval Kogman Chris 'BinGOs' Williams Philip Gwyn .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2012 by Matt Cashner (sungo). .PP This is free software, licensed under: .PP .Vb 1 \& The (three\-clause) BSD License .Ve