https://github.com/wgnet/hooks
Generic events dispatcher
https://github.com/wgnet/hooks
Last synced: 7 months ago
JSON representation
Generic events dispatcher
- Host: GitHub
- URL: https://github.com/wgnet/hooks
- Owner: wgnet
- License: apache-2.0
- Created: 2014-06-27T08:37:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-08-22T08:53:14.000Z (about 11 years ago)
- Last Synced: 2025-01-17T20:17:01.348Z (9 months ago)
- Language: Erlang
- Size: 297 KB
- Stars: 2
- Watchers: 12
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
hooks
=====Generic events dispatcher.
The components of a modular system shold interact with each other.
Yet it would be way better if they do not know anything about each other.
Hooks - is one of the ways to satisfy both of the latter critera.
API
===`-spec hooks:add_handler(HookID, {mfa, M, F, A}, Priority) -> ok.`
`-spec hooks:remove_handler(HookID, {mfa, M, F, A}, Priority) -> ok.`
`-spec hooks:run(HookID, AccIn, ConstArgs :: [ term() ] ) -> AccOut.`
This call runs the the pipeline of hook-handlers identified by `HookID` one by one according to their priorities passing `[Acc | ConstArgs]` as the arguments list.