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

[TODO]: builtin hook function in every rules packages #4

Open
HsiangNianian opened this issue Jul 18, 2024 · 0 comments
Open

[TODO]: builtin hook function in every rules packages #4

HsiangNianian opened this issue Jul 18, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@HsiangNianian
Copy link
Member

[14368]refactor: Comment hook function while running the rules packages

builtin hook function in every rules packages.

fae8d22...14368e5

        try:
            ##########################################################
            # @TODO: builtin hook function in every rules packages.
            ##########################################################
            # for _rule in self.rules:
            #     for rule_enable_hook_func in self._rule_enable_hooks:
            #         await rule_enable_hook_func(_rule)
            #     try:
            #         await _rule.enable()
            #     except Exception as e:
            #         self.error_or_exception(
            #             f"Enable rule {_rule!r} failed:", e)

            # for _rule in self.rules:
            #     for rule_run_hook_func in self._rule_run_hooks:
            #         await rule_run_hook_func(_rule)
            #     _rule_task = asyncio.create_task(_rule.safe_run())
            #     self._rule_tasks.add(_rule_task)
            #     _rule_task.add_done_callback(self._rule_tasks.discard)

            await self.should_exit.wait()

            if hot_reload_task is not None:  # pragma: no cover
                await hot_reload_task
        finally:
            # for _rule in self.rules:
            #     for rule_disable_hook_func in self._rule_disable_hooks:
            #         await rule_disable_hook_func(_rule)
            #     await _rule.disable()

hook types

  • rule_enable_hook_func
  • rule_run_hook_func
  • rule_disable_hook_func
@HsiangNianian HsiangNianian added the enhancement New feature or request label Jul 18, 2024
@HsiangNianian HsiangNianian self-assigned this Jul 18, 2024
@HsiangNianian HsiangNianian changed the title TODO: builtin hook function in every rules packages [TODO]: builtin hook function in every rules packages Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant