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

feat: add async methods #383

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion openfeature/api.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import typing

from openfeature import _event_support
from openfeature.client import OpenFeatureClient
from openfeature.client import AsyncOpenFeatureClient, OpenFeatureClient
from openfeature.evaluation_context import EvaluationContext
from openfeature.event import (
EventHandler,
Expand Down Expand Up @@ -39,6 +39,12 @@ def get_client(
return OpenFeatureClient(domain=domain, version=version)


def get_client_async(
domain: typing.Optional[str] = None, version: typing.Optional[str] = None
) -> AsyncOpenFeatureClient:
return AsyncOpenFeatureClient(domain=domain, version=version)


def set_provider(
provider: FeatureProvider, domain: typing.Optional[str] = None
) -> None:
Expand Down
Loading