Turns sync functions into async generator functions