indexify icon indicating copy to clipboard operation
indexify copied to clipboard

Support Async Functions

Open diptanu opened this issue 1 year ago • 2 comments

Currently functions in graph has to be synchronous -

def foo(url: str) -> str:
 pass

This is a problem because people might want async functions for functions that does IO.

async def foo(url: str) -> str:
  return await httpx.get(url).content

The function worker needs to detect if the user function is multiprocess and create an event loop, and call the function with asyncio.run or something of that nature. This might require our sdk to have async interfaces as well. That needs to be explored.

diptanu avatar Nov 11 '24 05:11 diptanu

cc @Default2882

diptanu avatar Nov 12 '24 08:11 diptanu

Will take a look at this! Feel free to assign it to me!

Default2882 avatar Nov 12 '24 08:11 Default2882