A
A
Alex Alex2018-10-27 00:33:04
Python
Alex Alex, 2018-10-27 00:33:04

How to set up callback on functions?

I have a function for POST / GET requests - call_api has a callback attached to it for a certain response from the server.
There is an authorization function - login, it happens that when the login is called, the callback is triggered, handles the error and returns to the login function where it was called and performs further work, how can I do it so that when the callback is called, it exits the login function, and after the callback is processed, it repeats the login function.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dimonchik, 2018-10-27
@dimonchik2013

break and return

V
Vasily Melnikov, 2018-10-30
@BacCM

Except how to rewrite the calling function in any way. And most likely, in addition to this, add another calling login.

B
BitRouter, 2018-10-31
@BitRouter

login = I dare to assume authorization, storing data in the session,
check the session before using the callback

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question