Sha256: d78b87290928a63f7c944a1302c12a156611eca1bf34dcf5b83897c89863de2b

Contents?: true

Size: 856 Bytes

Versions: 26

Compression:

Stored size: 856 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

26 entries across 26 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.4.7 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.6 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.5 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.4 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.3 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.4.2 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.3.0 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.2.0 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.14 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.13 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.12 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.11 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.10 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.9 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.8 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.7 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.6 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.5 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.4 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm
javonet-ruby-sdk-2.1.3 lib/javonet-ruby-sdk/Binaries/Perl/Windows/X64/lib/Javonet/Core/Handler/ReferencesCache.pm