I
I
IsaevDev2016-07-03 21:45:19
PHP
IsaevDev, 2016-07-03 21:45:19

What is the best way to organize delayed http requests?

I had high hopes for RabbitMQ, but it's not exactly what I need. Lots of bells and whistles
Is there a simpler task scheduler that passes an http request as a parameter, then immediately (or after a certain period of time) this scheduler sends the request, waits for the result, sends the next one, and so on?
There is an option to write this in java - is it worth it?
upd. all the main logic in php

Answer the question

In order to leave comments, you need to log in

6 answer(s)
S
Sergey Semenko, 2016-07-03
@IsaevDev

Perhaps these options are suitable:
1. Gearman (you can write a worker in Node.js).
2. Redis Pub/Sub + Node.js server (Broadcasting Events).

S
Sergey, 2016-07-03
Protko @Fesor

beanstalkd
or I didn't understand you. In this case, it is better to describe what problem you want to solve.

S
safenoob, 2016-07-03
@safenoob

let us suppose. the user reserves the item. after 30 minutes, you need to check the fact of order confirmation in the database

At the time of product reservation, a record flies to the database where datetime is the reservation time. A script runs on cron that selects all products where datetime > 30 minutes and checks orders for them, if there is no order, we remove the product from the reserve.

D
Dimonchik, 2016-07-04
@dimonchik2013

zherman for PCP is completely channeled, not such a monster as a rabbit
if you need a period of time - stick it into the worker random slip

A
Alexander Kosarev, 2016-07-04
@jaxtr

This task is quite simply implemented using Apache Camel . At least for me.
In general, yes, you can get by with a bunch of cron + script.

M
Maxim Alekhin, 2016-07-04
@Settler1

The simplest option in Unix is ​​2 tools for pending tasks:
1) the at command wget http://site.ru | at 06:00- will execute at the specified time
2) the sleep command sleep 4h && wget http://site.ru- will execute after the specified time
The command can be any, if the file that needs to be executed on your server, then you can use php instead of wget .
You can send commands through shell_exec

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question