pluggy icon indicating copy to clipboard operation
pluggy copied to clipboard

Move tracing "intercept" methods to `_HookCaller`?

Open goodboy opened this issue 5 years ago • 1 comments

This relates to #217 as well as discussion in other issues.

The main refactoring would include:

  • moving PluginManager._inner_hookexec lambda indirection onto the _HookCaller
  • possibly (and subsequently) remove PluginManager._hookexec entirely
  • re-work the tracing methods to support per hook tracing and if global tracing is desired have the manager loop through all underlying callers to insert trace functions.

goodboy avatar Jun 03 '20 21:06 goodboy

The first point is covered by #280.

For the second point I have a plan as well, will submit after the first PR is merged.

As for point 3, it should be possible, however the implementation plan of iterating over all _HookCallers is foiled by PluginManager.subset_hook_caller() which returns an untracked _HookCaller (and we probably don't want to track it, unless using weak references).

bluetech avatar Jun 26 '20 16:06 bluetech