Submit process to the server and release the user

0

I'm having a problem with an application that uses 3G and is slow to keep the user waiting.

Does anyone know any library that I can send information to the server and release the user?

The information is a batch with 100 sets of numbers that will be added in the bank one by one.

This is not an asynchronous code because I do not need to tell the user that I made a mistake or hit it. I'll simply send the information to the server and that's it.

    
asked by anonymous 11.10.2016 / 04:56

2 answers

0

You can use Celery to do this.

This is an asynchronous task-queue-based task queue library. It is focused on real-time operations, but it also supports scheduling.

Celery is well-suited to do what you need: run something after the web request is complete. In addition is trusted and used by apps like Instagram .

You basically write a task in Python and set up a Celery "worker". Then, when processing the requests, you put the execution in a queue that will be executed by that worker.

The fact that you do not need to tell the user about the result does not mean that there is no need to run asynchronous code. The asynchronous definition is execution in parallel.

    
11.10.2016 / 05:17
2

Oops!

Depending on what you need, the celery may be a bit much. When I have something simple that I need to do this queue schema, and asynchronous processing, I use rq .

It's very simple to use and has even a app for Django that makes it easy to implement.

Hugs!

    
13.10.2016 / 16:46