[go-nuts] Re: Go-native abstract service interface design

2023-11-17 Thread 'Brian Candler' via golang-nuts
I think it depends on what your semantic contract is for this interface. If the caller starts a server with Run(ctx), is it implied that cancelling of ctx should stop the running server? If so, ISTM that there is no need for a separate Shutdown() method. (And there would be no need for App and

[go-nuts] Re: Go-native abstract service interface design

2023-11-16 Thread Grant Zvolský
Upon reflection, I would make the following improvements to bring the interfaces closer to Go's philosophical ideals: * Remove the App interface because it only has one implementation * Remove the Named interface because all its usages seem to be replaceable with a package-scoped const * Split t

[go-nuts] Re: Go-native abstract service interface design

2023-11-15 Thread grant
edit: The `App` interface has just one implementation which adds the ~4 builtin "Runnables". It is used to implement 5-10 different services each of which adds its custom "Runnables". On Wednesday, November 15, 2023 at 7:06:08 AM UTC-5 grant wrote: > I've stumbled upon a set of interfaces that