Cache-Memcached-Fast

 view release on metacpan or  search on metacpan

lib/Cache/Memcached/Fast.pm  view on Meta::CPAN

sent to the server, and rejected there.  You may set I<max_size> to a
smaller value to avoid this.

=item I<check_args>

  check_args => 'skip'
  (default: not 'skip')

The value is a string.  Currently the only recognized string is
I<'skip'>.

By default all constructor parameter names are checked to be
recognized, and a warning is given for unknown parameter.  This will
catch spelling errors that otherwise might go unnoticed.

When set to I<'skip'>, the check will be bypassed.  This may be
desired when you share the same argument hash among different client
versions, or among different clients.

=back

=back

=head1 METHODS

=over

=item C<enable_compress>

  $memd->enable_compress($enable);

Enable compression when boolean I<$enable> is true, disable when
false.

Note that you can enable compression only when you set
L</compress_threshold> to some positive value and L</compress_methods>
is set.

I<Return:> none.

=item C<namespace>

  $memd->namespace;
  $memd->namespace($string);

Without the argument return the current namespace prefix.  With the
argument set the namespace prefix to I<$string>, and return the old
prefix.

I<Return:> scalar, the namespace prefix that was in effect before the
call.

=item C<set>

  $memd->set($key, $value);
  $memd->set($key, $value, $expiration_time);

Store the I<$value> on the server under the I<$key>.  I<$key> should
be a scalar.  I<$value> should be defined and may be of any Perl data
type.  When it is a reference, the referenced Perl data structure will
be transparently serialized by routines specified with
L</serialize_methods>, which see.

Optional I<$expiration_time> is a positive integer number of seconds
after which the value will expire and wouldn't be accessible any
longer.

I<Return:> boolean, true for positive server reply, false for negative
server reply, or I<undef> in case of some error.

=item C<set_multi>

  $memd->set_multi(
      [$key, $value],
      [$key, $value, $expiration_time],
      ...
  );

Like L</set>, but operates on more than one key.  Takes the list of
references to arrays each holding I<$key>, I<$value> and optional
I<$expiration_time>.

Note that multi commands are not all-or-nothing, some operations may
succeed, while others may fail.

I<Return:> in list context returns the list of results, each
I<$list[$index]> is the result value corresponding to the argument at
position I<$index>.  In scalar context, hash reference is returned,
where I<$href-E<gt>{$key}> holds the result value.  See L</set> to
learn what the result value is.

=item C<cas>

  $memd->cas($key, $cas, $value);
  $memd->cas($key, $cas, $value, $expiration_time);

Store the I<$value> on the server under the I<$key>, but only if CAS
(I<Consistent Access Storage>) value associated with this key is equal
to I<$cas>.  I<$cas> is an opaque object returned with L</gets> or
L</gets_multi> or L</gats> or L</gats_multi>.

See L</set> for I<$key>, I<$value>, I<$expiration_time> parameters
description.

I<Return:> boolean, true for positive server reply, false for negative
server reply, or I<undef> in case of some error.  Thus if the key
exists on the server, false would mean that some other client has
updated the value, and L</gets>, L</gats>, L</cas> command sequence should be
repeated.

B<cas> command first appeared in B<memcached> 1.2.4.

=item C<cas_multi>

  $memd->cas_multi(
      [$key, $cas, $value],
      [$key, $cas, $value, $expiration_time],
      ...
  );

Like L</cas>, but operates on more than one key.  Takes the list of



( run in 1.176 second using v1.01-cache-2.11-cpan-39bf76dae61 )