README
A module for sharing and reusing callback functions.
The most obvious use case is the callback functions of `GenServer` i.e. `handle_code/3`, `handle_cast/2` and `handle_info/2`.
Callback function sources have to be compiled together in the callback module to enable multiple implementations of the same callback to be found by pattern matching.
Although targetting `GenServer` callbacks, `Siariwyd` can be used to share any function’s implementations (callback or otherwise) that must be compiled together.
`Siariwyd` enables one or more implementations of a function to be register-ed in one or more donor modules and selectively include-d into a recipient (e.g. callback) module at compilation time.
See full documentation for details.
See my blog post for some background.
Installation
Add siariwyd to your list of dependencies in mix.exs:
def deps do
[{:siariwyd, "~> 0.1.0"}]
end
Examples
See the examples in the API documentation and also the blog post