You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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) becauseAvrogen.Schema.SchemaRegistry.init
can't be called twice (you getError: 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 theinit_registry
function that can be called fromApplication.start
.Created by @23Skidoo
The text was updated successfully, but these errors were encountered: