MCPcopy Index your code
hub / github.com/DoNewsCode/core / Shutdown

Method Shutdown

c.go:383–390  ·  view source on GitHub ↗

Shutdown iterates through every CloserProvider registered in the container, and calls them in the reversed order of registration.

()

Source from the content-addressed store, hash-verified

381// Shutdown iterates through every CloserProvider registered in the container,
382// and calls them in the reversed order of registration.
383func (c *C) Shutdown() {
384 modules := c.Modules()
385 for i := range modules {
386 if closer, ok := modules[len(modules)-i-1].(CloserProvider); ok {
387 closer.ProvideCloser()
388 }
389 }
390}
391
392// AddModuleFunc add the module after Invoking its constructor. Clean up
393// functions and errors are handled automatically.

Callers 4

httpServeMethod · 0.80
TestC_cleanupFunction · 0.80
TestContainer_ShutdownFunction · 0.80
Example_modulesFunction · 0.80

Calls 2

ModulesMethod · 0.65
ProvideCloserMethod · 0.65

Tested by 3

TestC_cleanupFunction · 0.64
TestContainer_ShutdownFunction · 0.64
Example_modulesFunction · 0.64