/usr/share/perl5/IPC/PubSub/Cache/PlainHash.pm is in libipc-pubsub-perl 0.29-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | package IPC::PubSub::Cache::PlainHash;
use strict;
use warnings;
use base 'IPC::PubSub::Cache';
my %cache;
use constant new => __PACKAGE__;
sub fetch {
my $self = shift;
@cache{@_};
}
sub store {
my ($self, $key, $val, $time, $expiry) = @_;
$cache{$key} = [$time => $val];
}
sub publisher_indices {
my ( $self, $chan ) = @_;
+{ %{ $cache{$chan} || {} } };
}
sub add_publisher {
my ($self, $chan, $pub) = @_;
$cache{$chan}{$pub} = 0;
}
sub remove_publisher {
my ($self, $chan, $pub) = @_;
delete $cache{$chan}{$pub};
}
sub get_index {
my ($self, $chan, $pub) = @_;
$cache{$chan}{$pub};
}
sub set_index {
my ($self, $chan, $pub, $idx) = @_;
$cache{$chan}{$pub} = $idx;
}
1;
|