Very simple code:
async def poll():
await asyncio.sleep(1)
def caller(somefunction):
somefunction() # we don't know if callable is async or not
def main():
caller(poll) # how to pass an async function "poll" here?
I want to call "poll" by passing it as a callable/lambda to "caller" function. Normally, in a well designed language, e.g. C# you'd do poll().Result because poll() returns a Task which has methods like Wait() and Result to block and wait OR you can use "await" if you want to block and wait AND return to the caller of the current async method you're in.