NAME
POE::Component::Lightspeed::Introspection - Discovering your network!
SYNOPSIS
use
POE;
# Spawn your client/server session here and connect to the network
# Find out the kernels in the network
my
$kernels
= list_kernels();
"Kernels:"
,
join
(
" ,"
,
@$kernels
);
# Query a specific kernel for it's sessions
# Remember, we need a RSVP specifier here
# This rsvp will get 2 events, one from each kernel it queried
# Inside an event handler where $_[SENDER] is a remote kernel
# Query a specific kernel / session for it's states
# Basically, this accepts the full destination specifier, only without the state parameter
# This is also allowed
# Madness, madness!
# Inside an event handler where $_[SENDER] is a remote kernel
ABSTRACT
This module presents an easy API
for
finding information about the network.
DESCRIPTION
All you need to do is import the 3 subroutines provided.
METHODS
list_kernels
Requires
no
arguments
Returns an arrayref of kernel names
list_sessions
Requires two arguments
- The kernel name to query
Can be a
scalar
with
the kernel name, or
'*'
Can be an arrayref full of kernel names
Can be
$_
[SENDER]
when
it's a remote kernel
- The RSVP to
send
the results
Must be a fully-qualified destination specifier as explained in the Lightspeed docs
NOTE: This will
return
every alias a session
has
, not only the first alias!
Returns nothing, the data will be sent to the RSVP
ARG0 = kernel name
ARG1 = arrayref of sessions
Example:
[
[
'mysession'
,
'secondalias'
,
'thirdalias'
,
],
[
'weeble'
,
],
[
'frobnicate'
,
]
]
list_states
Requires two arguments
- The kernel/session to query
Can be an arrayref as explained in the Lightspeed docs, without the 3rd element set
Can be a hashref
with
the KERNEL and SESSION
keys
Can be
$_
[SENDER]
when
it's a remote kernel
- The RSVP to
send
the results
Must be a fully-qualified destination specifier as explained in the Lightspeed docs
NOTE: This will
return
only one alias per session, to avoid confusion over duplicate aliases
Returns nothing, the data will be sent to the RSVP
ARG0 = kernel name
ARG1 = hashref of sessions -> array of states
Example:
{
'mysession'
=> [
'_stop'
,
'_default'
,
'mystate'
,
'mystate2'
,
],
'othersession'
=> [
'floo'
,
'bar'
,
]
}
EXPORT
Exports the 3 subs in EXPORT_OK
SEE ALSO
AUTHOR
Apocalypse <apocal@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2005 by Apocalypse
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.