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

Not possible to use schema registry if a dependency uses it #4

Open
cottinisimone opened this issue Sep 5, 2024 · 0 comments
Open

Comments

@cottinisimone
Copy link
Contributor

Since the Avrogen schema registry is essentially a global ETS table, it becomes awkward to use if you depend on avrogen in two different ways (say, directly, and via a dependency) because Avrogen.Schema.SchemaRegistry.init can't be called twice (you get Error: table name already exists).

The easiest fix is probably to make init check if the global table already exists with :ets.whereis, and add the current app's schemas to it if it does.

Also the schema registry doesn't really need to be a GenServer, it can just export the init_registry function that can be called from Application.start.

Created by @23Skidoo

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