Cache-Memcached-Fast
view release on metacpan or search on metacpan
lib/Cache/Memcached/Fast.pm view on Meta::CPAN
=item C<stats>
Not supported. Perhaps will appear in the future releases.
=back
=head1 Tainted data
In current implementation tainted flag is neither tested nor
preserved, storing tainted data and retrieving it back would clear
tainted flag. See L<perlsec|perlsec>.
=head1 Threads
This module is thread-safe when used with Perl >= 5.7.2. As with
other Perl data each thread gets its own copy of
Cache::Memcached::Fast object that is in scope when the thread is
created. Such copies share no state, and may be used concurrently.
For example:
use threads;
my $memd = Cache::Memcached::Fast->new({...});
sub thread_job {
$memd->set("key", "thread value");
}
threads->new(\&thread_job);
$memd->set("key", "main value");
Here both C<set>s will be executed concurrently, and the value of
I<key> will be either I<main value> or I<thread value>, depending on
the timing of operations. Note that C<$memd> inside C<thread_job>
internally refers to a different Cache::Memcached::Fast object than
C<$memd> from the outer scope. Each object has its own connections to
servers, its own counter of outstanding replies for L</nowait> mode,
etc.
New object copy is created with the same constructor arguments, but
initially is not connected to any server (even when master copy has
open connections). No file descriptor is allocated until the command
is executed through this new object.
You may safely create Cache::Memcached::Fast object from threads other
than main thread, and/or pass them as parameters to threads::new().
However you can't return the object from top-level thread function.
I.e., the following won't work:
use threads;
sub thread_job {
return Cache::Memcached::Fast->new({...});
}
my $thread = threads->new(\&thread_job);
my $memd = $thread->join; # The object will be destroyed here.
This is a Perl limitation (see L<threads/"BUGS AND LIMITATIONS">).
=head1 SUPPORT
The code repository is available for public review and contribution at
L<https://github.com/JRaspass/Cache-Memcached-Fast>.
Please report any bugs or feature requests through the issue tracker at
L<https://github.com/JRaspass/Cache-Memcached-Fast/issues>.
=head1 SEE ALSO
=over
=item *
L<Cache::Memcached> - original pure Perl B<memcached> client.
=item *
L<https://memcached.org> - B<memcached> website.
=back
=head1 AUTHORS
=over
=item *
Tomash Brechko <tomash.brechko@gmail.com> - design and implementation.
=item *
Michael Monashev <postmaster@softsearch.ru> - project management, design
suggestions, testing.
=item *
James Raspass <jraspass@gmail.com> - recent additions and current maintenance.
=back
=head1 ACKNOWLEDGEMENTS
Development of this module was sponsored by Monashev Co. Ltd.
Thanks to Peter J. Holzer for enlightening on UTF-8 support.
Thanks to Yasuhiro Matsumoto for the initial Win32 patch.
=head1 COPYRIGHT AND LICENSE
Copyright © 2007-2010 Tomash Brechko. All rights reserved. This program is
free software; you can redistribute it and/or modify it under the same terms
as Perl itself.
( run in 3.084 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )