Thanks for sharing and I already considered using Knigge
, before I found a simple solution to avoid the boilerplate of behaviors and implementation details. Currently I leverage on Module.spec_to_callback/2, which is in my use-case good enough.
Along the lines I implemented it like this: https://gist.github.com/jhattwich/6f7acbaaa3cd2f9cdbf2afe8c13328f0