Support the ongoing development of Laravel.io →
Input Queues Architecture

Hi,

Currently im using Laravel 4 for a few years now. And I really love it! But I have a questions how to solve a certain problem. To give an indication.

A user can plan an event on a certain start en and time. As soon as this starttime is reached it needs to execute a Command. (just a CURL exec with some params)

Currenty we are firing this on the commandline with exec (linux at command). But this is not very reliable cause the start and endtime can change so we need to remove this job from the system.

So what is the best approuch for this?

  • putting the curl exec in a queue with beanstalkd and run it once at a certain time? And delete the job when the user changes his event?
  • Any other options? A cron job would be specific at 1 minute correct?

Would love to hear any ideas!

Jules

Last updated 3 years ago.
0

You can write the user's planned events to the events table. Surely they can be edited. Every minute (or more if the time is not so exact) a cron job runs a command, it can be an artisan command, which goes through the events table from the database and looks if it is time to start one of them.

0

Hi Mkblade,

Thanks for your reply. The events are already in the database with the correct timestamp. But looping threw the table to check if we need to start anything every 5 seconds. Would be rather resource consuming?

0

If running a single query with selection over one or two columns and no joins every few seconds is too much for your server/db to handle, you need to re-evaluate your hosting solution.

0

@nCrazed I manage my own machines. It should not be an issue. But not sure what it would take from the machine when running queries every 5 seconds.

@tkprocat

Thanks for the iron.io link :) I will look into that. Might be a usefull solution. Iron.io is like beanstalkd correct?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.