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

Option to not run event loop on import #93

Open
phil65 opened this issue Dec 18, 2024 · 0 comments
Open

Option to not run event loop on import #93

phil65 opened this issue Dec 18, 2024 · 0 comments

Comments

@phil65
Copy link

phil65 commented Dec 18, 2024

Currently tokencost can not get imported lazily inside an async application properly because it tries to run its own eventloop for updating the cost data.
I think that it should either:

  1. check for an existing eventloop and use that one if existing
    or, better
  2. allow an option to not update at all on import (perhaps via environment variable? That would allow to keep bw compat)

I think in general doing IO work on an import is not really ideal, would love if that could be reconsidered.

Thank you!

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

1 participant