node: Basic graceful shutdown

This commit is contained in:
Łukasz Magiera
2019-09-17 16:23:08 +02:00
parent 215f95aa5b
commit 83f1a336a6
10 changed files with 102 additions and 19 deletions
+28
View File
@@ -0,0 +1,28 @@
package valctx
import (
"context"
"time"
)
type Context struct {
Parent context.Context
}
func (c *Context) Deadline() (deadline time.Time, ok bool) {
return
}
func (c *Context) Done() <-chan struct{} {
return nil
}
func (c *Context) Err() error {
return nil
}
func (c *Context) Value(key interface{}) interface{} {
return c.Parent.Value(key)
}
var _ context.Context = &Context{}