Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Laravel 4.x Queue

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 120
    Comment on it

    Laravel Queue is one of the best feather of laravel 4.x. When we want to make our site fast and we have to fetch and store large amount of data then we will run our query on back end. In laravel 4.x by using queue we can run time consuming on back end , Such as sending an e-mail,fetching large amount of records etc.

    Laravel Queue file is stored in app/config/queue.php. For this we will use n number of web services which are already available in Laravel, which includes a Beanstalkd, IronMQ, Amazon SQS, Redis, and synchronous (for local use) driver.

    Use of Queue:

    To perform a new job onto the queue we will use following syntax.

    Queue::push('SendEmail', array('message' => $message));
    

    In this "first argument is the name of the class and should be used to process the job and second argument is the array of data that should be pass to the handler.

    And In handler we have fire function there we write our code we want to perform in back end.

    Example

    class SendEmail {
    
        public function fire($job, $data)
        {
            //Here we write our function.
        }
    
    }
    

    By this way we can define our backend process in laravel 4.x.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: