Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow replacing of Kazan.Client.Imp via configuration #75

Open
chazsconi opened this issue Oct 9, 2019 · 1 comment
Open

Allow replacing of Kazan.Client.Imp via configuration #75

chazsconi opened this issue Oct 9, 2019 · 1 comment

Comments

@chazsconi
Copy link
Collaborator

As mentioned in #72 we have a wrapper around Kazan.run/2 for instrumentation.

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.

@obmarg
Copy link
Owner

obmarg commented Oct 9, 2019

This is an interesting idea, not one I'd considered. Not sure where I stand: is there a reason to do this in Kazan vs. implementing this in your app?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants