Skip to content

Allow to specify an actor class in actor decorator. - #169

Closed
gilbsgilbs wants to merge 1 commit into
Bogdanp:masterfrom
gilbsgilbs:actor-class
Closed

Allow to specify an actor class in actor decorator.#169
gilbsgilbs wants to merge 1 commit into
Bogdanp:masterfrom
gilbsgilbs:actor-class

Conversation

@gilbsgilbs

Copy link
Copy Markdown
Contributor

Sorry, I had to move the decorator function down so that I can get the Actor class declared soon enough, which kind of messes up the diff.

Fixes #163

@gilbsgilbs
gilbsgilbs force-pushed the actor-class branch 2 times, most recently from 31c4b93 to 2b3e8c1 Compare February 12, 2019 22:28
@davidt99

Copy link
Copy Markdown
Contributor

I would like to see the LazyActor you mentioned in #163 in this PR so it becomes "official" because I ran into a similar issue.

Comment thread dramatiq/actor.py Outdated
return "Actor(%(actor_name)s)" % vars(self)


def actor(fn=None, *, actor_name=None, queue_name="default", priority=0, broker=None, actor_class=Actor, **options):

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nitpick: please move actor_class before actor_name. All of those are keyword-only arguments so it's not a breaking change and I like how it reads a little better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@Bogdanp

Bogdanp commented Feb 14, 2019

Copy link
Copy Markdown
Owner

@davidt99 I'd rather we mention this somewhere in the guide rather than include the code for LazyActor.

@gilbsgilbs I just have that one tiny little nitpick. Otherwise, this looks good to me.

@Bogdanp Bogdanp added this to the v1.5.0 milestone Feb 14, 2019
@gilbsgilbs
gilbsgilbs force-pushed the actor-class branch 2 times, most recently from aec55ff to 9c792aa Compare February 14, 2019 18:40
@gilbsgilbs

Copy link
Copy Markdown
Contributor Author

Thanks for the review @Bogdanp .

@Bogdanp

Bogdanp commented Feb 18, 2019

Copy link
Copy Markdown
Owner

@gilbsgilbs thanks again. This is now merged with rebase.

@Bogdanp Bogdanp closed this Feb 18, 2019
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

Successfully merging this pull request may close these issues.

3 participants