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

Feature Request: accept async functions in on_kernel_start #989

Open
1 of 2 tasks
iisakkirotko opened this issue Jan 28, 2025 · 0 comments
Open
1 of 2 tasks

Feature Request: accept async functions in on_kernel_start #989

iisakkirotko opened this issue Jan 28, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@iisakkirotko
Copy link
Collaborator

iisakkirotko commented Jan 28, 2025

Feature Request

  • The requested feature would break current behaviour
  • I would be interested in opening a PR for this feature

What problem would this feature solve? Please describe.

For certain functionality that you might want to execute on kernel start, you need to call asynchronous functions. It would be useful to accept these for solara.lab.on_kernel_start

Describe the solution you'd like

The cleanest would be simply allowing

@solara.lab.on_kernel_start
async def init():
    await database.connect()

    async def cleanup():
        await database.disconnect()
    return cleanup
@iisakkirotko iisakkirotko added the enhancement New feature or request label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant