use Moose;
+
=head1 NAME
MooseX::Attribute::Cached; Cache your Moose Attribute Value
package MyApp;
use Moose;
- with 'MooseX::Attribute::Cached.pm';
+ with 'MooseX::Attribute::Cached';
## Cache Storage Options Declared Manually
has 'shared_key_1' => (
like Memcached. All instances with access to the same cache will share and
update a common value. That way:
-1) All instances share the same attribute slot. Updates made by one
+1) All instances share the same attribute value. Updates made by one
attribute are seen by all instances, even on different servers as long as
-they share a distributed caching system (such as Memcached).
-
+they share a distributed caching system (such as Memcached).
+
2) It can be a sort of 'persistance lite' although I highly recommend using
a real persistance system, such as a database or L<MooseX::Storage>.
-
+
3) You could probably use this as a sort of expensive class attribute, but
you will likely be more happy with L<MooseX::ClassAttribute>
+Please keep in mind that the process of setting and getting values in and out
+of the Cache is asynchronise. When a value is updated, this is no 'Publish /
+Subscribe' system running to let all the instances using this attribute know it
+ha been changed. Also, since the last value that was retrieved from the Cache
+is stored by the instance, any references will point to this.
+
At this time, this supports two Cachings systems, Memcached and FastMmap. If
you have need for other cache types, adding a driver for it should be easy, so
please send your patches and test cases.
=head1 COPYRIGHT & LICENSE
-Copyright 2008 John Napiorkowski, all rights reserved.
+Copyright 2008 John Napiorkowski
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.