Make NewManager actually create a new provider #1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "zeripath/session:new-manager-new-provider"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The current code for NewManager means that the same provider is reinitialised
leading to a potential datarace on reinitialisation.
This PR simply causes the NewManager to reinstatiate the selected provider.
Signed-off-by: Andrew Thornton art27@cantab.net
@ -322,2 +322,3 @@
// It returns an error when requested provider name isn't registered.
func NewManager(name string, opt Options) (*Manager, error) {
p, ok := providers[name]
exemplar, ok := providers[name]
I think storing the value as a function to create provider is better.
waiting as per lunny ...
That breaks the API - which is fine but this change can just be merged without changing the API.
74b5bb6d0b
to14eb9ee2f7
OK
We now have a
RegisterFn(name string, providerFn func() Provider)
function whichRegister(name string, provider Provider)
calls into with the results of the old newProvider function.