On Tue, Nov 24, 2015 at 11:05 AM, Joseph Norris <jozefn...@gmail.com> wrote:

> if I set a tag to a value of a hash:
>
> $self->{cache}->set('tag',$hash);
>
> is the hash ref set in memcache that will point back to my hash or do I
> have to actually have a %hash to be used in
> $self->{cache}->set('tag',%hash);
>

Like all other caching modules that do anything outside of your local
process, Cache::Memcached passes your data to Storable to flatten it into a
blob of data, so what gets sent over the wire is just that blob with the
complete contents of your hash. Storable will follow references.

and do I have to have some unique identifier for the the tag so that the in
> memory hash will be related to the actual script that is calling it.
> in other words will each run of the script get a different instance of
> 'tag' with its own unique %hash?
>

I'm not sure I understand what you're asking. When you call get() on the
cache to load the hash, binary data gets passed to Storable and turned into
a hash in your local process. If you make changes to the local hash after
that without storing them back to memcached, no other process will see
them. If you call get() on the same key in another process, that process
will also get a hash in local memory, and no connection will exist between
that and the one in your first process.

- Perrin

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to memcached+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to