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

20 lines
538 B
Go

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 {
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 {
return WithProcessClosed(context.Background(), p)
}