Yii 1.1: ememcacheq

Simple queue class for MemcacheQ.
3 followers

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

Total 1 comment

#9244 report it
vitman at 2012/07/31 07:35am
Feedback

Any feedback are welcome.

Leave a comment

Please to leave your comment.

Create extension
Downloads