Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 738 Bytes

5.handler.md

File metadata and controls

14 lines (9 loc) · 738 Bytes

Hook handler definition and usage

The hook handler alter the behavior of original handler passed by call or call_sync. Its implementation allos multiple execution patterns:

  • Execute code before and after the original handler
  • Alter the arguments arguments
  • Return a modified or different value
  • Stop the handler execution pipeline

Arguments

When the handler defines 1 argument, it can only access and modify the interception point arguments.

When the handler defines 2 arguments, it get access to the original handler or the handler returned by the previous hook. It can then decide to return it, execute it or even return an alternative handler. It can also prevent other hooks from being executed by returning null.