Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Async Functions #1017

Open
diptanu opened this issue Nov 11, 2024 · 2 comments
Open

Support Async Functions #1017

diptanu opened this issue Nov 11, 2024 · 2 comments
Assignees

Comments

@diptanu
Copy link
Collaborator

diptanu commented Nov 11, 2024

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 diptanu assigned diptanu and unassigned diptanu Nov 12, 2024
@diptanu
Copy link
Collaborator Author

diptanu commented Nov 12, 2024

cc @Default2882

@Default2882
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants