Skip to content

Option to not run event loop on import #93

@phil65

Description

@phil65

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions