ObjStore
view release on metacpan or search on metacpan
lib/ObjStore/AppInstance.pm view on Meta::CPAN
1;
=head1 NAME
ObjStore::AppInstance - helper class for interactive tools
=head1 SYNOPSIS
use ObjStore::AppInstance;
my $app = ObjStore::AppInstance->new('posh', scalar(getpwuid($>)));
my $hash = $app->top(); # fetch the top level hash for this key
$app->modified(); # set the modification time
$app->prune($oldest); # delete instances older than $oldest
=head1 DESCRIPTION
I'm not sure if this will be depreciated...
lib/ObjStore/ServerInfo.pm view on Meta::CPAN
# Auto-retry of deadlocks can cause havoc. You must take
# responsibility to address this yourself.
#ObjStore::set_max_retries(0);
sub new {
my $o = shift->SUPER::new(@_);
$$o{exe} = $EXE;
$$o{argv} = \@ARGV;
$$o{host} = $HOST;
$$o{pid} = $$;
$$o{uid} = getpwuid($>);
$$o{mtime} = time;
$SELF = $o->new_ref;
$o;
}
sub touch {
my ($class, $time) = @_;
$time ||= time;
my $s = $SELF->focus;
if ($s) {
use vars qw($term @ORINC @HistoryBuf $Unloaded);
@ORINC = @INC;
$Unloaded = 0;
sub new {
my ($class) = @_;
my $o = bless {}, $class;
# my $o = $class->SUPER::new('posh', pvars => [qw(ttype view)]);
$o->{user} ||= scalar(getpwuid($>));
$o->{app} = ObjStore::AppInstance->new('posh', $o->{user});
$o->{ttype} = $open_mode eq 'mvcc'? 'read' : 'update';
# ObjStore::set_max_retries(0);
$ObjStore::TRANSACTION_PRIORITY = 0x100; #don't conflict with real jobs
begin('update', sub {
my $t = $o->{app}->top();
$t->{view} ||= new Posh::View($t);
$o->{prompt} = $t->{view}->enter($o->{app}->get_pathname());
$$o{widgets} = \@w;
$o;
}
package Editor;
use ObjStore;
use IO::File;
use Qt;
use vars qw(@ISA $USER $ABOUT);
@ISA = qw(Qt::Widget);
$USER = scalar(getpwuid($>));
sub new {
my $o = shift->SUPER::new();
$o->resize(500,500);
$$o{db} = shift;
$o->setCaption("qtposh ".$$o{db}->get_pathname);
my @w;
my $m = Qt::MenuBar->new($o);
push @w, $m;
( run in 0.451 second using v1.01-cache-2.11-cpan-8d75d55dd25 )