add wait option

This commit is contained in:
Asim Aslam 2017-05-31 19:47:50 +01:00
parent f7a9207c7a
commit e1a1f1c0f0

View File

@ -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) {