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

Propose to rename callback hooks from "on_***" to "before_***" (or "after_***") #3387

Open
johnnyshields opened this issue May 20, 2024 · 2 comments
Labels

Comments

@johnnyshields
Copy link
Contributor

Currently there are many hooks named on_***. Internally these map to options named before_***. It would be much clearer to users if we used the before/after nomenclature everywhere, as it would make it more obvious the exact timing of events.

We could alias and deprecate the old hook names for the time being.

  #     | DSL Method         |  Options Key            | Fork Block Location |
  #     | on_worker_boot     | :before_worker_boot     | inside, before      |
  #     | on_worker_shutdown | :before_worker_shutdown | inside, after       |
  #     | on_refork          | :before_refork          | inside              |
@dentarg
Copy link
Member

dentarg commented May 22, 2024

Makes sense to me.

Not sure I understand the "Fork Block Location" column above. (I have not looked at any code related to this)

@dentarg
Copy link
Member

dentarg commented Jun 5, 2024

Looks like #3258 aims to do this

@dentarg dentarg added the feature label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants