开发者

Is there a Perl memcached client that works on Windows XP?

开发者 https://www.devze.com 2022-12-19 06:42 出处:网络
I\'m trying to find an alternative to the Cache::Memcached Perl module that works with Windows XP. Or, to somehow get Cache::Memcached working on Windows XP.

I'm trying to find an alternative to the Cache::Memcached Perl module that works with Windows XP. Or, to somehow get Cache::Memcached working on Windows XP.

A bit of background: the production environtment (web server) is Solaris 10, which I've already installed memcached and Cache::Memcached, and all works fine. However, the development PC is Windows XP, and Cache::Memcached won't install properly, and definitely doesn't work. See:

cpantesters.org report on Cache::Memcached

same error that I receive

Perl version: This is perl, v5.10.1 built for MSWin32-x86-multi-thread

Note: Changing the development environment to Unix / Linux is not an option at this point. Would consider other Perl based c开发者_如何学编程aching options suitable for a web environment.


Here is a solution, that may take a bit extra work, but is do-able.

Create a custom daemon script as a host for your memory cache, then using Win32::Pipe, turn it into a pipe server. Using NamedPipes, your client scripts can then connect to it and perform transactions (eg. store/retrieve data/memory ).

If you want to get fancy, you can find Win32 extensions, to create a Win32 Service for your daemon, so it loads automatically on boot.

You can download the current version of Win32::Pipe, and see examples @ http://www.roth.net/perl/pipe/ .

Note: the Win32::Pipe module that comes with the ActiveState Perl distribution, is no good.


If you are caching strings / scalar types and not serializing / deserializing objects, you might be able to get away with calling the memcached client directly from sockets on the development box. The memcached protocol is very simple and if you're mostly trying to verify caching behavior you wouldn't need a persistent connection to the memcached demon and could get away with 'send message to socket... get single response' as an operational model.

0

精彩评论

暂无评论...
验证码 换一张
取 消