1

I am new to redis and predis. I want to create a simple sign up form and want to send data to user email id. I have written the script for sign up and email sending. Now I want to make a queue in which i want to put both of the jobs. and as the user click on submit then processor should not wait for sending email. sending email should be put in a queue. and should be processed in background. please guys can anyone give me a reference of such script in php using redis.

1
  • You can put your tasks into redis and iterate over it using cron or you can use celery Commented Aug 22, 2012 at 6:17

1 Answer 1

2

What you can do is, push the data to a redis list and pick data from the worker which is polling the list for any data and then send it by email.

Steps:

Make a new predis client $redis = new Predis\Client("parameter");

A predis list $redis->lpush(listname, "Data");

and finally a worker(Cron) which is taking data from the same list

$redis->rpop(listname, variable);

Other work around way is to use pub/sub of redis.

Try redis here and documentation- redis commands

Predis examples. In examples folder.

Sign up to request clarification or add additional context in comments.

4 Comments

hey amit. i have done the basic things but i am not getting how to start with these things. is there any tutorial from where i can start begining
is there any example from where i can learn that how the things are going on
you can start with redis here http://try.redis-db.com/ and there are redis commands here http://redis.io/commands . Try working with redis-cli first, predis is just a php implementation of redis.
predis https://github.com/nrk/predis have a lot of examples in examples folder. Check that out too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.