Add Router interface

This commit is contained in:
Asim Aslam
2019-01-08 20:32:47 +00:00
parent 4cb41721f1
commit f46828be33
4 changed files with 29 additions and 8 deletions

View File

@@ -25,8 +25,12 @@ type Options struct {
HdlrWrappers []HandlerWrapper
SubWrappers []SubscriberWrapper
// The register expiry time
RegisterTTL time.Duration
// The router for requests
Router Router
// Debug Handler which can be set by a user
DebugHandler debug.DebugHandler
@@ -164,6 +168,13 @@ func RegisterTTL(t time.Duration) Option {
}
}
// WithRouter sets the request router
func WithRouter(r Router) Option {
return func(o *Options) {
o.Router = r
}
}
// Wait tells the server to wait for requests to finish before exiting
func Wait(b bool) Option {
return func(o *Options) {