NicWorkAccount
NicWorkAccount

Reputation: 21

Fast Api Rq job vs Normal Api call

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)

Upvotes: 0

Views: 142

Answers (0)

Related Questions