DWH_File
view release on metacpan or search on metacpan
lib/DWH_File/Kernel.pm view on Meta::CPAN
my $file = $_[ 0 ];
my $class = ref $this || $this;
my %dummy = ();
my $dbm = tie %dummy, $DWH_File::default_dbm, @_;
unless ( $dbm ) { die "Failed to create dbm file $file: $!" }
my $self = { dbm => $dbm,
file => $file,
cache => DWH_File::Cache->new,
garbage => {},
dummy => \%dummy,
alive => 1,
};
bless $self, $class;
$self->{ id_mill } = DWH_File::ID_Mill->new( $self, 'id_mill' );
$self->{ id_mill }{ current } ||= 0;
$self->{ uri_pool } = DWH_File::Registry::URI->new( $self, 'uri_pool' );
DWH_File::Registry::URI->register( $self );
$self->{ class_pool } = DWH_File::Registry::Class->new( $self,
'class_pool' );
my $worker_id = $self->fetch_property( 'worker' );
if ( defined $worker_id ) {
lib/DWH_File/Kernel.pm view on Meta::CPAN
else { warn "Garbage anomaly: $goid ~ $goner" }
}
}
}
sub release {
my ( $self ) = @_;
$self->{ uri_pool }->release( $self );
delete $_[ 0 ]->{ dbm };
untie %{ $_[ 0 ]->{ dummy } };
$self->{ alive } = 0;
}
sub wipe {
my ( $self ) = @_;
$self->save_state;
$self->purge_garbage;
$self->release;
}
1;
lib/DWH_File/Work.pm view on Meta::CPAN
return $self;
}
sub tie_reference {
my $this = shift;
$_[ 5 ] = 'DWH_File::Tie::Hash';
return $this->SUPER::tie_reference( @_ );
}
sub wipe {
if ( $_[ 0 ]->{ kernel }{ alive } ) {
$_[ 0 ]->{ kernel }->wipe;
}
}
1;
__END__
=head1 NAME
( run in 1.260 second using v1.01-cache-2.11-cpan-39bf76dae61 )