status-go/vendor/github.com/jbenet/goprocess/context/derive.go

20 lines
538 B
Go
Raw Normal View History

package goprocessctx
import (
"context"
goprocess "github.com/jbenet/goprocess"
)
// OnClosingContext derives a context from a given goprocess that will
// be 'Done' when the process is closing
func OnClosingContext(p goprocess.Process) context.Context {
2019-06-09 07:24:20 +00:00
return WithProcessClosing(context.Background(), p)
}
// OnClosedContext derives a context from a given goprocess that will
// be 'Done' when the process is closed
func OnClosedContext(p goprocess.Process) context.Context {
2019-06-09 07:24:20 +00:00
return WithProcessClosed(context.Background(), p)
}