add wait option
This commit is contained in:
parent
f7a9207c7a
commit
e1a1f1c0f0
@ -165,6 +165,16 @@ func RegisterTTL(t time.Duration) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// Wait tells the server to wait for requests to finish before exiting
|
||||
func Wait(b bool) Option {
|
||||
return func(o *Options) {
|
||||
if o.Context == nil {
|
||||
o.Context = context.Background()
|
||||
}
|
||||
o.Context = context.WithValue(o.Context, "wait", b)
|
||||
}
|
||||
}
|
||||
|
||||
// Adds a handler Wrapper to a list of options passed into the server
|
||||
func WrapHandler(w HandlerWrapper) Option {
|
||||
return func(o *Options) {
|
||||
|
Loading…
Reference in New Issue
Block a user