Skip to content

Comments

sd: add Stop method to Instancer interface#583

Merged
peterbourgon merged 1 commit intomasterfrom
instancer-stop
Sep 17, 2017
Merged

sd: add Stop method to Instancer interface#583
peterbourgon merged 1 commit intomasterfrom
instancer-stop

Conversation

@peterbourgon
Copy link
Member

Every implementation (modulo mock/test impls) already provided this method, and so it makes sense to lift it to the interface definition.

Closes #566.

Every implementation (modulo mock/test impls) already provided this
method, and so it makes sense to lift it to the interface definition.

Closes #566.
@peterbourgon
Copy link
Member Author

@yurishkuro
Copy link
Contributor

as mentioned in the issue, it's a code smell, but not worth fighting over. LGTM.

I would recommend a clear spec of the expected behavior of Stop() in the comments, e.g. "instancer guarantees no more updates will be sent to subscribers once the Stop() function returns".

side note - I personally prefer using io.Closer signature for such methods.

@basvanbeek
Copy link
Member

I'm ok with it. I have no preference for io.Closer over Stop.

@peterbourgon
Copy link
Member Author

I think I prefer func Stop() to func Close() error as the semantics are rather different.

@peterbourgon peterbourgon merged commit e9af46a into master Sep 17, 2017
@peterbourgon peterbourgon deleted the instancer-stop branch September 17, 2017 20:23
jamesgist pushed a commit to jamesgist/kit that referenced this pull request Nov 1, 2024
sd: add Stop method to Instancer interface
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

Successfully merging this pull request may close these issues.

3 participants