Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

kiokudb::typemap::entry::callback(3pm) [debian man page]

KiokuDB::TypeMap::Entry::Callback(3pm)			User Contributed Perl Documentation		    KiokuDB::TypeMap::Entry::Callback(3pm)

NAME
KiokuDB::TypeMap::Entry::Callback - Callback based inflation/deflation of objects SYNOPSIS
KiokuDB::TypeMap->new( entries => { 'My::Class' => KiokuDB::TypeMap::Entry::Callback->new( expand => "new", # My::Class->new(%$self) collapse => sub { my $self = shift; return %$self; # provide args to 'new' in this example }, id => sub { "foo" }, # 'id' callback is optional ), }, ); DESCRIPTION
This KiokuDB::TypeMap entry provides callback based inflation/deflation. The major limitation of this method is that it cannot be used for self referential structures. This is because the object being inflated is only constructed after all of its arguments are. For the overwhelming majority of the use cases this is good enough though. ATTRIBUTES
collapse A method name or code reference invoked on the object during collapsing. This is evaluated in list context, and the list of values it returns will be collapsed by the KiokuDB::Collapser and then stored. expand A method name or code reference invoked on the class of the object during loading. The arguments are as returned by the "collapse" callback. id An optional method name or code reference invoked to get an ID for the object. If one is not provided the default (UUID based) generation is used. intrinsic A boolean denoting whether or not the object should be collapsed with no ID, and serialized as part of its parent object. This is useful for value like objects, for whom the reference address makes no difference (such as URI objects). perl v5.12.4 2010-10-11 KiokuDB::TypeMap::Entry::Callback(3pm)

Check Out this Related Man Page

KiokuDB::Backend::Role::TXN(3pm)			User Contributed Perl Documentation			  KiokuDB::Backend::Role::TXN(3pm)

NAME
KiokuDB::Backend::Role::TXN - Backend level transaction support. SYNOPSIS
package MyBackend; use Moose; with qw( KiokuDB::Backend KiokuDB::Backend::Role::TXN ); sub txn_begin { ... } sub txn_commit { ... } sub txn_rollback { ... } DESCRIPTION
This API is inspired by standard database transactions much like you get with DBI. This is the low level interface required by "txn_do" in KiokuDB. OPTIONAL METHODS
txn_do $code, %callbacks This method should evaluate the code reference in the context of a transaction, inside an "eval". If any errors are caught the transaction should be aborted, otherwise it should be committed. This is much like "txn_do" in DBIx::Class::Schema. The "rollback" callback should be fired when the transaction will be aborted. REQUIRED METHODS
txn_begin [ $parent_txn ] Begin a new transaction. This method can return a transaction handle that will later be passed to "txn_commit" or "txn_rollback" as necessary. The current handle will be passed to nested calls to "txn_begin". txn_commit $txn Commit the transaction. txn_rollback $txn Rollback the transaction. perl v5.12.4 2010-10-11 KiokuDB::Backend::Role::TXN(3pm)
Man Page