Fast Api Rq job vs Normal Api call

80 Views Asked by At

I am new to python Rq and I am trying to understand his usage in FastApi. Why it would be better to use a Rq job instead a normal api call?

In other words, why it would be better to do:

@app.post('/')
def my_method(function_args):
    my_queue.enqueue(queue_name, function, *function_args)

instead of:

@app.post('/')
def my_method(function_args):
    function(function_args)
0

There are 0 best solutions below