Sha256: 7d639a723a0d5839cfb94832be7ef8202a5c0db9b129bb6f203ab8e89adadd45

Contents?: true

Size: 812 Bytes

Versions: 15

Compression:

Stored size: 812 Bytes

Contents

package Javonet::Core::Handler::ReferencesCache;
use strict;
use warnings FATAL => 'all';
use lib 'lib';
use Exporter;
use Moose;
use Data::UUID;
use feature 'state';

our %reference_cache;
my $ug    = Data::UUID->new;

sub new {
    my ($class) = @_;
    state $instance;

    if (! defined $instance) {
        $instance = bless {}, $class;
    }
    return $instance;
}

sub cache_reference{
    my ($self, $object_reference) = @_;
    my $uuid = $ug->create_str();
    my $guid = $uuid;
    $reference_cache{$guid} = $object_reference;
    return $guid;
}

sub resolve_reference{
    my ($self, $perl_command) = @_;
    return $reference_cache{$perl_command->{payload}[0]}
}

sub delete_reference{
    my ($self, $perl_command) = @_;
    delete $reference_cache{$perl_command->{payload}[0]};
}


no Moose;
1;

Version data entries

15 entries across 12 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.5.7 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.5.6 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.5.5 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.5.4 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.5.3 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.5.2 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.5.1 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.5.0 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.11 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.10 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.9 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.9 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.8 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.8 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Core/Handler/ReferencesCache.pm