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.
Installed memcacheq and php extension to use it.
'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;
http://memcachedb.org/memcacheq/
git://github.com/vitman/EMemCacheQ.git
Total 1 comment
Any feedback are welcome.
Leave a comment
Please login to leave your comment.