GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DATA::REMEMBER::POE (3)

.ds Aq ’

NAME

Data::Remember::POE a brain for Data::Remember linked to the session heap

CONTENTS

SYNOPSIS



  # An absurd POE programming demonstrating how Data::Remember::POE works
 
  use Data::Remember POE => Memory;
  use POE;

  POE::Session->create(
      inline_states => {
          _start      => \&start,
          count_to_10 => \&count_to_10,
          print_count => \&print_count,
      },
      heap => brain->new_heap,
  );
  POE::Kernel->run;

  sub start {
      my $kernel = $_[KERNEL];
      $kernel->yield( count_to_10 );
  }

  sub count_to_10 {
      my $kernel = $_[KERNEL];

      for my $count ( 1 .. 10 ) {
          remember [ count => $count ] = "The count is $count.\n";
          $kernel->yield( print_count => $count );
      }
  }

  sub print_count {
      my ($kernel, $count) = @_[KERNEL,ARG0];

      my $message = recall [ count => $count ];
      print $message;
  }



DESCRIPTION

Normally, when using Data::Remember, the brain used is linked to the package from which the various functions are called. By using Data::Remember::POE to store your brain, the calls to remember, recall, and forget will instead work according to the current POE session.

This means that it’s possible to define two POE sessions that use Data::Remember from the same package, but each will use a different brain.

METHODS

    new CONFIG

Creates a new object and tells the brain to use CONFIG as the default heap configuration.

    new_heap [ CONFIG ]

Creates a new brain object to be stored in a sessions heap established when create in POE::Session is called. This new heap will be created according to the configuration from when Data::Remember was used. For example,



  use Data::Remember POE => Memory;



This declaration would case new_heap to initialize a new brain using Data::Remember::Memory.

You may also specify a CONFIG argument, which will override the configuration set when Data::Remember was used. For example,



  POE::Session->create(
      inline_states => { ... },
      heap => brain->new_heap( YAML => file => brain.yml ),
  );



This overrides whatever options were set during the use and uses Data::Remember::YAML instead.

    remember QUE, FACT

Stores FACT into QUE for the brain in the current POE session.

    recall QUE

Fetches the fact that has been stored in QUE for the brain in the current POE session heap.

    forget QUE

Deletes any fact that has been stored in QUE for the brain in the current POE session heap.

    brain

Returns the brain stored in the current session heap, in case you need to call any brain methods there.

SEE ALSO

Data::Remember

AUTHOR

Andrew Sterling Hanenkamp <hanenkamp@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2007 Boomer Consulting, Inc. All Rights Reserved.

This program is free software and may be modified and distributed under the same terms as Perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DATA::REMEMBER::POE (3) 2007-10-10

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.