We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The GenericActor pattern causes a few problem today:
ActorParams = ParamSpec("ActorParams") ReturnT = TypeVar("ReturnT") class ClassActorP(Protocol[ActorParams, ReturnT]): def __init__(*args: ActorParams.args, **kwargs: ActorParams.kwargs) -> None: ... def perform(self) -> ReturnT: ... def get_actor_from_class( actor_class: Type[ClassActorP[ActorParams, ReturnT]], **options: Expand[OptionsT] ) -> Actor[ActorParams, ReturnT]: def _actor(*args: ActorParams.args, **kwargs: ActorParams.kwargs) -> ReturnT: return actor_class(*args, **kwargs).perform() return _actor
Example:
@attr.s(auto_attribs=True) class Add: x: int y: int def perform(self) -> int: return self.x + self.y add = get_actor_from_class(Add, max_retries=5)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Motivation
The GenericActor pattern causes a few problem today:
Proposal
Example:
The text was updated successfully, but these errors were encountered: