ememcacheq Simple queue class for MemcacheQ.

  1. Requirements
  2. Usage
  3. Resources

Simple class for memcacheQ. I think it can be helpful for those, who want to use memcacheQ, but dont want to use Yii default memcache class because it a bit awkward.

Requirements

Installed memcacheq and php extension to use it.

Usage

  1. copy EMemCacheQ folder to your application.extensions folder
  2. add in your config in components section:
'components' => array(
//..//
'mailQueue' => array( //name can be whatever you want
            'class' => 'ext.ememcacheq.EMemCacheQ',
            'server' => array(
                    'host' => 'localhost', 
                    'port' => 22201,
                    'nameQueue'=>'mail' // queue name.
            )
        ),
/* you can use any count of queues
'otherQueue' => array(
            'class' => 'EMemCacheQ',
            'server' => array(
                    'host' => 'localhost', 
                    'port' => 22201,
                    'nameQueue'=>'otherQueue'
            )
        ),*/
)

Than in you code simply

Yii::app()->mailQueue->set('value1');
Yii::app()->mailQueue->set('value2');
echo Yii::app()->mailQueue->get();
echo Yii::app()->mailQueue->get();

if queue is empty, get() wil return false;

Resources

http://memcachedb.org/memcacheq/

git://github.com/vitman/EMemCacheQ.git

1 0
3 followers
528 downloads
Yii Version: 1.1
License: GPL-3.0
Category: Caching
Developed by: vitman
Created on: Jul 24, 2012
Last updated: 12 years ago

Downloads

show all

Related Extensions