I'm creating the asynchronous function call in my application to process the task(function).
I have tried with threadpoolexecutor as shown below for asynchronous call but it is not working as expected, kindly let me know What I have done wrongly?
class MainTest:
def __init__(self): pass
def show_msg(self):
print('inside show msg function..!')
time.sleep(3)
def executor_call(self):
executor = concurrent.futures.ThreadPoolExecutor(max_workers=1)
executor.submit(obj.show_msg())
executor.shutdown(wait=False)
print('Hi')
obj = MainTest()
obj.executor_call()
I am expecting above code output like
Hi inside show msg function..!
but I am getting
inside show msg function..! Hi