Skip to content

Recognize actor with module name instead of only func name #640

@z0z0r4

Description

@z0z0r4

Issues

GitHub issues are for bugs. If you have questions, please ask them on the mailing list.

Checklist

  • Does your title concisely summarize the problem?
  • Did you include a minimal, reproducible example?
  • What OS are you using?
  • What version of Dramatiq are you using?
  • What did you do?
  • What did you expect would happen?
  • What happened?

Creating two func decorated with @actor without setting its actor_name in different module, import the first registered func and send message to run, and you may find that dramatiq run the second but not the first func...

It seems dramatiq recognize func defaultly by its func name...

In many cases, the function names in different modules are set to the same. I think that it is an unreasonable design to use the function name as the only index.

actor_name = actor_name or fn.__name__

Should we change the default actor_name to actor_name = actor_name or f'{fn.__module__}.{fn.__name__}'?

I am not familiar with the source code. Based on my initial understanding, it seems that actor_name is only used as the key of the destination function and can be set at will without duplication.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions