[component] clarifying lifecycle expectation (#6535)
Extended the documentation of the component to include safe Shutdown expectations. Co-authored-by: Alex Boten <alex@boten.ca>
This commit is contained in:
parent
032d7ce73f
commit
ee05613162
|
|
@ -57,6 +57,10 @@ type Component interface {
|
|||
// Shutdown is invoked during service shutdown. After Shutdown() is called, if the component
|
||||
// accepted data in any way, it should not accept it anymore.
|
||||
//
|
||||
// This method must be safe to call:
|
||||
// - without Start() having been called
|
||||
// - if the component is in a shutdown state already
|
||||
//
|
||||
// If there are any background operations running by the component they must be aborted before
|
||||
// this function returns. Remember that if you started any long-running background operations from
|
||||
// the Start() method, those operations must be also cancelled. If there are any buffers in the
|
||||
|
|
|
|||
Loading…
Reference in New Issue