.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) .\" .\" 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 "IKC::Responder 3pm" .TH IKC::Responder 3pm "2011-08-27" "perl v5.12.4" "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::Component::IKC::Responder \- POE IKC state handler .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 5 \& use POE; \& use POE::Component::IKC::Responder; \& create_ikc_responder(); \& ... \& $kernel\->post(\*(AqIKC\*(Aq, \*(Aqpost\*(Aq, $to_state, $state); \& \& $ikc\->publish(\*(Aqmy_name\*(Aq, [qw(state1 state2 state3)]); .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module implements \s-1POE\s0 \s-1IKC\s0 state handling. The responder handles posting states to foreign kernels and calling states in the local kernel at the request of foreign kernels. .PP There are 2 interfaces to the responder. Either by sending states to the \&'\s-1IKC\s0' session or the object interface. While the latter is faster, the better behaved, because \s-1POE\s0 is a cooperative system. .SH "STATES/METHODS" .IX Header "STATES/METHODS" .ie n .SS """spawn""" .el .SS "\f(CWspawn\fP" .IX Subsection "spawn" .Vb 1 \& POE::Component::IKC::Responder\->spawn(); .Ve .PP This function creates the Responder session and object. Normally, POE::Component::IKC::Client or POE::Component::IKC::Server does this for you. But in some applications you want to make sure that the Responder is up and running before then. .ie n .SS """post""" .el .SS "\f(CWpost\fP" .IX Subsection "post" Sends an state request to a foreign kernel. Returns logical true if the state was sent and logical false if it was unable to send the request to the foreign kernel. This does not mean that the foreign kernel was able to post the state, however. Parameters are as follows : .ie n .IP """foreign_state""" 2 .el .IP "\f(CWforeign_state\fR" 2 .IX Item "foreign_state" Specifier for the foreign state. See POE::Component::IKC::Specifier. .ie n .IP """parameters""" 2 .el .IP "\f(CWparameters\fR" 2 .IX Item "parameters" A reference to anything you want the foreign state to get as \s-1ARG0\s0. If you want to specify several parameters, use an array ref and have the foreign state dereference it. .Sp .Vb 3 \& $kernel\->post(\*(AqIKC\*(Aq, \*(Aqpost\*(Aq, \& {kernel=>\*(AqSyslog\*(Aq, session=>\*(Aqlogger\*(Aq, state=>\*(Aqlog\*(Aq}, \& [$faculty, $priority, $message]; .Ve .Sp or .Sp .Vb 1 \& $ikc\->post(\*(Aqpoe://Syslog/logger/log\*(Aq, [$faculty, $priority, $message]); .Ve .Sp This logs an state with a hypothetical logger. .PP See the \*(L"\s-1PROXY\s0 \s-1SENDER\s0\*(R" below. .ie n .SS """call""" .el .SS "\f(CWcall\fP" .IX Subsection "call" This is identical to \f(CW\*(C`post\*(C'\fR, except it has a 3rd parameter that describes what state should receive the return value from the foreign kernel. .PP .Vb 3 \& $kernel\->post(\*(AqIKC\*(Aq, \*(Aqcall\*(Aq, \& \*(Aqpoe://Pulse/timeserver/time\*(Aq, \*(Aq\*(Aq, \& \*(Aqpoe:get_time\*(Aq); .Ve .PP or .PP .Vb 2 \& $ikc\->call({kernel=>\*(AqPulse\*(Aq, session=>\*(Aqtimeserver\*(Aq, state=>\*(Aqtime\*(Aq}, \& \*(Aq\*(Aq, \*(Aqpoe://me/get_time\*(Aq); .Ve .PP This asks the foreign kernel 'Pulse' for the time. 'get_time' state in the current session is posted with whatever the foreign state returned. .PP You do not have to publish callback messages, because they are temporarily published. How temporary? They can be posted from a remote kernel \s-1ONCE\s0 only. This, of course, is a problem because someone else could get in a post before the callback. Such is life. .ie n .IP """foreign_state""" 3 .el .IP "\f(CWforeign_state\fR" 3 .IX Item "foreign_state" Identical to the \f(CW\*(C`post\*(C'\fR \f(CW\*(C`foreign_state\*(C'\fR parameter. .ie n .IP """parameters""" 3 .el .IP "\f(CWparameters\fR" 3 .IX Item "parameters" Identical to the \f(CW\*(C`post\*(C'\fR \f(CW\*(C`parameters\*(C'\fR parameter. .ie n .IP """rsvp""" 3 .el .IP "\f(CWrsvp\fR" 3 .IX Item "rsvp" Event identification for the callback. That is, this state is called with the return value of the foreign state. Can be a \f(CW\*(C`foreign_state\*(C'\fR specifier or simply the name of an state in the current session. .PP .Vb 8 \& $kernel\->call(\*(AqIKC\*(Aq, \*(Aqpost\*(Aq, \& {kernel=>\*(Aqe\-comm\*(Aq, session=>\*(AqCC\*(Aq, state=>\*(Aqcheck\*(Aq}, \& {CC=>$cc, expiry=>$expiry}, folder=>$holder}, \& \*(Aqis_valid\*(Aq); \& # or \& $ikc\->call(\*(Aqpoe://e\-comm/CC/check\*(Aq, \& {CC=>$cc, expiry=>$expiry}, folder=>$holder}, \& \*(Aqpoe://me/is_valid\*(Aq); .Ve .PP This asks the e\-comm server to check if a credit card number is \*(L"well formed\*(R". Yes, this would probably be massive overkill. .PP The \f(CW\*(C`rsvp\*(C'\fR state does not need to be published. \s-1IKC\s0 keeps track of the rsvp state and will allow the foreign kernel to post to it. .PP See the \*(L"\s-1PROXY\s0 \s-1SENDER\s0\*(R" below. .ie n .SS """default""" .el .SS "\f(CWdefault\fP" .IX Subsection "default" Sets the default foreign kernel. You must be connected to the foreign kernel first. .PP Unique parameter is the name of the foreign kernel kernel. .PP Returns logical true on success. .ie n .SS """register""" .el .SS "\f(CWregister\fP" .IX Subsection "register" Registers foreign kernel names with the responder. This is done during the negociation phase of \s-1IKC\s0 and is normaly handled by \f(CW\*(C`IKC::Channel\*(C'\fR. Will define the default kernel if no previous default kernel exists. .PP First parameter is either a single kernel name. Second optional parameter is an array ref of kernel aliases to be registered. .ie n .SS """unregister""" .el .SS "\f(CWunregister\fP" .IX Subsection "unregister" Unregisters one or more foreign kernel names with the responder. This is done when the foreign kernel disconnects by POE::Component::IKC::Channel. If this is the default kernel, there is no more default kernel. .PP First parameter is either a single kernel name or a kernel alias. Second optional parameter is an array ref of kernel aliases to be unregistered. This second parameter is a tad silly, because if you unregister a remote kernel, it goes without saying that all it's aliases get unregistered also. .ie n .SS """register_local""" .el .SS "\f(CWregister_local\fP" .IX Subsection "register_local" Registers new aliases for local kernel with the responder. This is done internally by POE::Component::IKC::Server and POE::Component::IKC::Client. Will \s-1NOT\s0 define the default kernel. .PP First and only parameter is an array ref of kernel aliases to be registered. .ie n .SS """publish""" .el .SS "\f(CWpublish\fP" .IX Subsection "publish" Tell \s-1IKC\s0 that some states in the current session are available for use by foreign sessions. .ie n .IP """session""" 2 .el .IP "\f(CWsession\fR" 2 .IX Item "session" A session alias by which the foreign kernels will call it. The alias must already have been registered with the local kernel. .ie n .IP """states""" 2 .el .IP "\f(CWstates\fR" 2 .IX Item "states" Arrayref of states that foreign kernels may post. .Sp .Vb 3 \& $kernel\->post(\*(AqIKC\*(Aq, \*(Aqpublish\*(Aq, \*(Aqme\*(Aq, [qw(foo bar baz)]); \& # or \& $ikc\->publish(\*(Aqme\*(Aq, [qw(foo bar baz)]); .Ve .ie n .SS """retract""" .el .SS "\f(CWretract\fP" .IX Subsection "retract" Tell \s-1IKC\s0 that some states should no longer be available for use by foreign sessions. You do not have to retract all published states. .ie n .IP """session""" 2 .el .IP "\f(CWsession\fR" 2 .IX Item "session" Same as in \f(CW\*(C`publish\*(C'\fR .ie n .IP """states""" 2 .el .IP "\f(CWstates\fR" 2 .IX Item "states" Same as in \f(CW\*(C`publish\*(C'\fR. If not supplied, *all* published states are retracted. .Sp .Vb 3 \& $kernel\->post(\*(AqIKC\*(Aq, \*(Aqretract\*(Aq, \*(Aqme\*(Aq, [qw(foo mibble dot)]); \& # or \& $ikc\->retract(\*(Aqme\*(Aq, [qw(foo)]); .Ve .ie n .SS """published""" .el .SS "\f(CWpublished\fP" .IX Subsection "published" .Vb 1 \& $list=$kernel\->call(IKC=>\*(Aqpublished\*(Aq, $session); .Ve .PP Returns a list of all the published states. .PP .Vb 1 \& $hash=$kernel\->call(IKC=>\*(Aqpublished\*(Aq); .Ve .PP Returns a hashref, keyed on session IDs. Values are arrayref of states published by that session. .ie n .IP """session""" 2 .el .IP "\f(CWsession\fR" 2 .IX Item "session" A session alias that you wish the list of states for. .ie n .SS """subscribe""" .el .SS "\f(CWsubscribe\fP" .IX Subsection "subscribe" Subscribe to foreign sessions or states. When you have subscribed to a foreign session, a proxy session is created on the local kernel that will allow you to post to it like any other local session. .ie n .IP """specifiers""" 3 .el .IP "\f(CWspecifiers\fR" 3 .IX Item "specifiers" An arrayref of the session or state specifiers you wish to subscribe to. While the wildcard '*' kernel may be used, only the first kernel that acknowledges the subscription will be proxied. .ie n .IP """callback""" 3 .el .IP "\f(CWcallback\fR" 3 .IX Item "callback" Either a state (for the state interface) or a coderef (for the object interface) that is posted (or called) when all subscription requests have either been replied to, or have timed out. .Sp When called, it has a single parameter, an arrayref of all the specifiers that \s-1IKC\s0 was able to subscribe to. It is up to you to see if you have enough of the foreign sessions or states to get the job done, or if you should give up. .Sp While \f(CW\*(C`callback\*(C'\fR isn't required, it makes a lot of sense to use it because it is only way to find out when the proxy sessions become available. .Sp Example : .Sp .Vb 2 \& $ikc\->subscribe([qw(poe://Pulse/timeserver)], \& sub { $kernel\->post(\*(Aqpoe://Pulse/timeserver\*(Aq, \*(Aqconnect\*(Aq) }); .Ve .Sp (\s-1OK\s0, that's a bad example because we don't check if we actually managed to subscribe or not.) .Sp .Vb 10 \& $kernel\->post(\*(AqIKC\*(Aq, \*(Aqsubscribe\*(Aq, \& [qw(poe://e\-comm/CC poe://TouchNet/validation \& poe://Cantax/JDE poe://Informatrix/JDE) \& ], \& \*(Aqpoe:subscribed\*(Aq, \& ); \& # and in state \*(Aqsubscribed\*(Aq \& sub subscribed \& { \& my($kernel, $specs)=@_[KERNEL, ARG0]; \& if(@$specs != 4) \& { \& die "Unable to find all the foreign sessions needed"; \& } \& $kernel\->post(\*(Aqpoe://Cantax/JDE\*(Aq, \*(Aqwrite\*(Aq, {...somevalues...}); \& } .Ve .Sp This is a bit of a mess. You might want to use the \f(CW\*(C`subscribe\*(C'\fR parameter to \*(L"spawn\*(R" instead. .Sp Subscription receipt timeout is currently set to 120 seconds. .ie n .SS """unsubscribe""" .el .SS "\f(CWunsubscribe\fP" .IX Subsection "unsubscribe" Reverse of the \*(L"subscribe\*(R" method. However, it is currently not documented well. .ie n .SS """ping""" .el .SS "\f(CWping\fP" .IX Subsection "ping" Responds with '\s-1PONG\s0'. This is auto-published, so it can be called from remote kernels to see if the local kernel is still around. In fact, I don't see any other use for this. .PP .Vb 2 \& $kernel\->post(\*(Aqpoe://remote/IKC\*(Aq, \*(Aqping\*(Aq, \*(Aqsome_state\*(Aq); \& $kernel\->delay(\*(Aqsome_state\*(Aq, 60); # timeout \& \& sub some_state \& { \& my($pong)=$_[ARG0]; \& return if $pong; # all is cool \& \& # YOW! Remote kernel timed out. RUN AROUND SCREAMING! \& } .Ve .ie n .SS """shutdown""" .el .SS "\f(CWshutdown\fP" .IX Subsection "shutdown" Hopefully causes \s-1IKC\s0 and all peripheral sessions to dissapear in a puff of smoke. At the very least, any sessions left will be either not related to \&\s-1IKC\s0 or barely breathing (that is, only have aliases keeping them from \s-1GC\s0). This should allow you to sanely shut down your process. .ie n .SS """monitor""" .el .SS "\f(CWmonitor\fP" .IX Subsection "monitor" Allows a session to monitor the state of remote kernels. Currently, a session is informed when a remote kernel is registered, unregistered, subscribed to or unsubscribed from. One should make sure that the \s-1IKC\s0 alias exists before trying to monitor. Do this by calling POE::Component::IKC::Responder\->spawn or in an \f(CW\*(C`on_connect\*(C'\fR callback. .PP .Vb 1 \& $kernel\->post(\*(AqIKC\*(Aq, \*(Aqmonitor\*(Aq, $remote_kernel_id, $states); .Ve .ie n .IP "$remote_kernel_id" 3 .el .IP "\f(CW$remote_kernel_id\fR" 3 .IX Item "$remote_kernel_id" Name or alias or \s-1IKC\s0 specifier of the remote kernel you wish to monitor. You can also specify \f(CW\*(C`*\*(C'\fR to monitor \s-1ALL\s0 remote kernels. If you do, your monitor will be called several times for a given kernel. This is because a kernel has one name and many aliases. For example, a remote kernel will have a unique \s-1ID\s0 within the local kernel, a name (passed to or generated by create_ikc_{kernel,client}) and a globaly unique \s-1ID\s0 assigned by the remote kernel via \f(CW$kernel\fR\->\s-1ID\s0. This suprises some people, but see the short note after the explanation of the callback parameters. .Sp Note: An effort has been made to insure that when monitoring \f(CW\*(C`*\*(C'\fR, \&\*(L"register\*(R" is first called with the remote kernel's unique \s-1ID\s0, and subsequent calls are aliases. This can't be guaranteed at this time, however. .ie n .IP "$states" 3 .el .IP "\f(CW$states\fR" 3 .IX Item "$states" Hashref that specifies what callback states are called when something interesting happens. If \f(CW$state\fR is empty or undef, the session will no longer monitor the given remote kernel. .SS "Callback states" .IX Subsection "Callback states" The following states can be monitored: .ie n .IP """register""" 6 .el .IP "\f(CWregister\fR" 6 .IX Item "register" Called when a remote kernel or alias is registered. This is equivalent to when the connection phase is finished. .ie n .IP """unregister""" 6 .el .IP "\f(CWunregister\fR" 6 .IX Item "unregister" Called when a remote kernel or alias is unregistered. This is equivalent to when the remote kernel disconnects. .ie n .IP """subscribe""" 6 .el .IP "\f(CWsubscribe\fR" 6 .IX Item "subscribe" Called when \s-1IKC\s0 succeeds in subscribing to a remote session. \s-1ARG3\s0 is an IKC::Specifier of what was subscribed to. Use this for posting to the proxy session. .ie n .IP """unsubscribe""" 6 .el .IP "\f(CWunsubscribe\fR" 6 .IX Item "unsubscribe" Called when \s-1IKC\s0 succeeds in unsubscribing from a remote session. .ie n .IP """shutdown""" 6 .el .IP "\f(CWshutdown\fR" 6 .IX Item "shutdown" You are informed whenever someone tries to do a sane shutdown of \s-1IKC\s0 and all peripheral sessions. This will called only once, after somebody posts an IKC/shutdown event. .ie n .IP """data""" 6 .el .IP "\f(CWdata\fR" 6 .IX Item "data" Little bit of data (can be scalar or reference) that is passed to the callback. This allows you to more magic. .PP The callback states are called the following parameters : .ie n .IP """ARG0""" 6 .el .IP "\f(CWARG0\fR" 6 .IX Item "ARG0" Name of the kernel that was passed to poe://*/IKC/monitor .ie n .IP """ARG1""" 6 .el .IP "\f(CWARG1\fR" 6 .IX Item "ARG1" \&\s-1ID\s0 or alias of remote kernel from \s-1IKC\s0's point of view. .ie n .IP """ARG2""" 6 .el .IP "\f(CWARG2\fR" 6 .IX Item "ARG2" A flag. If this is true, then \s-1ARG1\s0 is the remote kernel unique \s-1ID\s0, if false, then \s-1ARG1\s0 is an alias. This is mostly useful when monitoring \f(CW\*(C`*\*(C'\fR and is in fact a bit bloatful. .ie n .IP """ARG3""" 6 .el .IP "\f(CWARG3\fR" 6 .IX Item "ARG3" \&\f(CW\*(C`$state\->{data}\*(C'\fR ie any data you want. .ie n .IP """ARG4"" ... ""ARGN""" 6 .el .IP "\f(CWARG4\fR ... \f(CWARGN\fR" 6 .IX Item "ARG4 ... ARGN" Callback-specific parameters. See above. .PP Most of the time, \s-1ARG0\s0 and \s-1ARG1\s0 will be the same. Exceptions are if you are monitoring \f(CW\*(C`*\*(C'\fR or if you supplied a full \s-1IKC\s0 event specifier to IKC/monitor rather then just a plain kernel name. .ie n .SS "Short note about monitoring all kernels with ""*""" .el .SS "Short note about monitoring all kernels with \f(CW*\fP" .IX Subsection "Short note about monitoring all kernels with *" There are 2 reasons circonstances in which you will be monitoring all remote kernels : names known in advance and names unknown in advance. .PP If you know kernel names in advance, you might be better off monitoring a given kernel name. However, you might prefer doing a case-like compare on \&\s-1ARG1\s0 (with regexes, say). This would be useful for clustering, where various redundant kernels could follow a naming convention like [application]\-[host], so you could compare \f(CW\*(C`ARG1\*(C'\fR with \f(CW\*(C`/^credit\-/\*(C'\fR to find out if you want to set up specific things for that kernel. .PP Not knowing the name of a kernel in advance, you could be doing some sort of autodiscovery or maybe just monitoring for debuging, logging or book-keeping purposes. You obviously don't want to do autodiscovery for every alias of every kernel, only for the \*(L"cannonical name\*(R", hence the need for \s-1ARG2\s0. .SS "Short note the second" .IX Subsection "Short note the second" You are more then allowed (in fact, you are encouraged) to use the same callback states when monitoring multiple kernels. In this case, you will find \s-1ARG0\s0 useful for telling them apart. .PP .Vb 6 \& $kernel\->post(\*(AqIKC\*(Aq, \*(Aqmonitor\*(Aq, \*(Aq*\*(Aq, \& {register=>\*(Aqremote_register\*(Aq, \& unregister=>\*(Aqremote_unregister\*(Aq, \& subscribe=>\*(Aqremote_subscribe\*(Aq, \& unsubscribe=>\*(Aqremote_unsubscribe\*(Aq, \& data=>\*(Aqmagic box\*(Aq}); .Ve .PP Now remote_{register,unregister,subscribe,unsubscribe} is called for any remote kernel. .PP .Vb 1 \& $kernel\->post(\*(AqIKC\*(Aq, \*(Aqmonitor\*(Aq, \*(AqPulse\*(Aq, {register=>\*(Aqpulse_connected\*(Aq}); .Ve .PP \&\f(CW\*(C`pulse_connected\*(C'\fR will be called in current session when you succeed in connecting to a kernel called 'Pulse'. .PP .Vb 1 \& $kernel\->post(\*(AqIKC\*(Aq, \*(Aqmonitor\*(Aq, \*(Aq*\*(Aq); .Ve .PP Session is no longer monitoring all kernels, only 'Pulse'. .PP .Vb 1 \& $kernel\->post(\*(AqIKC\*(Aq, \*(Aqmonitor\*(Aq, \*(AqPulse\*(Aq, {}); .Ve .PP Now we aren't even interested in 'Pulse'; .SH "EXPORTED FUNCTIONS" .IX Header "EXPORTED FUNCTIONS" .ie n .SS """create_ikc_responder""" .el .SS "\f(CWcreate_ikc_responder\fP" .IX Subsection "create_ikc_responder" This function creates the Responder session and object. However, you don't need to call this directly, because POE::Component::IKC::Client or POE::Component::IKC::Server does this for you. .PP Deprecated, use \*(L"spawn\*(R". .SH "PROXY SENDER" .IX Header "PROXY SENDER" Event handlers invoked via \s-1IKC\s0 will have a proxy \s-1SENDER\s0 session. You may use it to post back to the remote session. .PP .Vb 1 \& $poe_kernel\->post( $_[SENDER], \*(Aqresponse\*(Aq, @args ); .Ve .PP Normally this proxy session is available during the invocation of the event handler. You may claim it for longer by setting an external reference: .PP .Vb 2 \& $heap\->{remote} = $_[SENDER]\->ID; \& $poe_kernel\->refcount_increment( $heap\->{remote}, \*(AqMINE\*(Aq ); .Ve .PP POE::Component::IKC will detect this and create a new proxy session for future calls. It will then be \s-1UP\s0 \s-1TO\s0 \s-1YOU\s0 to free the session: .PP .Vb 1 \& $poe_kernel\->refcount_decrement( $heap\->{remote}, \*(AqMINE\*(Aq ); .Ve .PP Note that you will have to publish any events that will be posted back. .SH "BUGS" .IX Header "BUGS" Sending session references and coderefs to a foreign kernel is a bad idea. At some point it would be desirable to recurse through the paramerters and and turn any session references into state specifiers. .PP The \f(CW\*(C`rsvp\*(C'\fR state in call is a bit problematic. \s-1IKC\s0 allows it to be posted to once, but doesn't check to see if the foreign kernel is the right one. .PP \&\f(CW\*(C`retract\*(C'\fR does not currently tell foreign kernels that have subscribed to a session/state about the retraction. .PP \&\f(CW\*(C`call()\*(C'\fRing a state in a proxied foreign session doesn't work, for obvious reasons. .SH "AUTHOR" .IX Header "AUTHOR" Philip Gwyn, .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" Copyright 1999\-2011 by Philip Gwyn. All rights reserved. .PP This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP See .SH "SEE ALSO" .IX Header "SEE ALSO" \&\s-1POE\s0, POE::Component::IKC::Server, POE::Component::IKC::Client, POE::Component::IKC::ClientLite, POE::Component::IKC::Channel, POE::Component::IKC::Proxy, POE::Component::IKC::Freezer, POE::Component::IKC::Specifier.