It would be useful if the module that Kazan.run/1 and Kazan.run/2 delegates to could be changed by configuration. This way we could easy provide our own implementation which wraps calls to Kazan.Client.Imp.run/2 with instrumentation.
This would also be useful to allow Kazan.Client.Imp to be replaced by a mock module for testing an app that uses Kazan.
To do this I would also suggest moving Kazan.Client.Imp.run!/2 to the Kazan module (as it's just a wrapper around run/2) and leaving run/2 as the only function that is required to be implemented in Kazan.Client.Imp or a mock implementation. A behaviour could also be added.
@obmarg I can provide a PR for this if you agree with the approach.
As mentioned in https://github.com/obmarg/kazan/pull/72 we have a wrapper around
Kazan.run/2
for instrumentation.It would be useful if the module that
Kazan.run/1
andKazan.run/2
delegates to could be changed by configuration. This way we could easy provide our own implementation which wraps calls toKazan.Client.Imp.run/2
with instrumentation.This would also be useful to allow
Kazan.Client.Imp
to be replaced by a mock module for testing an app that uses Kazan.To do this I would also suggest moving
Kazan.Client.Imp.run!/2
to theKazan
module (as it's just a wrapper aroundrun/2
) and leavingrun/2
as the only function that is required to be implemented inKazan.Client.Imp
or a mock implementation. A behaviour could also be added.@obmarg I can provide a PR for this if you agree with the approach.