-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add factories #349
base: develop
Are you sure you want to change the base?
Add factories #349
Conversation
@@ -32,7 +34,21 @@ def from_cli(cls, args: Optional[Sequence[str]] = None) -> "SchedulerArgs": | |||
formatter_class=ArgumentDefaultsHelpFormatter, | |||
description="Subcommand to run scheduler", | |||
) | |||
parser.add_argument("scheduler", help="Path to scheduler") | |||
parser.add_argument( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need two parameters. Specify only factory. We can check if the imported scheduler is a factory after we import it.
taskiq/abc/broker_factory.py
Outdated
from taskiq.abc.broker import AsyncBroker | ||
|
||
|
||
class BrokerFactory(ABC): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a class for that? Shouldn't just path to function be enough?
taskiq/cli/worker/args.py
Outdated
@@ -59,13 +60,24 @@ def from_cli( | |||
""" | |||
parser = ArgumentParser(formatter_class=ArgumentDefaultsHelpFormatter) | |||
parser.add_argument( | |||
"broker", | |||
"--broker", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question as for the scheduler.
taskiq/abc/scheduler_factory.py
Outdated
from taskiq import TaskiqScheduler | ||
|
||
|
||
class TaskiqSchedulerFactory(ABC): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question.
@s3rius fixed |
No description provided.