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

Add integrations #16

Open
chriso opened this issue Jul 3, 2024 · 0 comments
Open

Add integrations #16

chriso opened this issue Jul 3, 2024 · 0 comments

Comments

@chriso
Copy link
Contributor

chriso commented Jul 3, 2024

The Python SDK has a set of integrations, that enable categorization of error and output values from various SDKs and APIs. See https://github.com/dispatchrun/dispatch-py/tree/main/src/dispatch/integrations

We should integrations here too.

In terms of categorizing errors, we could hook into the error => Status mapping here.

Categorization of output values will be a bit harder. We could ask users to wrap values before returning them from their functions, and then add categorization and serialization hooks to the wrapper. This is essentially what we've done with the dispatchhttp package. Ideally though users should be able to return whatever value they like, and we do the wrapping automatically.

Another difference compared to Python is the inability to detect whether a dependency has been imported, so that we can dynamically import the integration (1). An alternative is to host integrations as submodules and have the submodules register integrations using an init hook. The user could then import the integration with an underscore/side-effect import. This is what we've done elsewhere.

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

1 participant