D
D
dimickh2016-10-24 15:52:30
Ruby on Rails
dimickh, 2016-10-24 15:52:30

What is the best way to implement a background task to monitor changes on an external site?

You need to create a background task that will monitor user actions on a third-party site.
For example: in order to get some information about a user on a social network, it is necessary that the bot account be friends with this user.
The algorithm of actions is as follows:
1. The bot sends a request for friendship
2. Every minute, it checks with a request to the api whether the friendship offer has been accepted.
The problem is that while the worker is checking confirmations, it is performing one task and the rest of the tasks are piling up in the queue (i.e. it cannot send friend requests to other people).
Actually the question is how best to do so that the bot can send many friendship proposals without waiting for confirmation.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Andreev, 2016-10-24
@dimickh

Detail the task, i.e. one task is to check that this particular user is added / not added as a friend.
That is, you run not one user check task, but for each check by task.

C
Chronic 86, 2016-10-24
@chronic86

https://habrahabr.ru/post/94574/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question