Make connection limit configurable

This commit is contained in:
Harshavardhana
2015-06-06 14:22:51 -07:00
parent 6263b99e5a
commit 8b43655d9f
5 changed files with 82 additions and 48 deletions

View File

@@ -43,7 +43,9 @@ type MemoryFactory struct {
func (f MemoryFactory) GetStartServerFunc() StartServerFunc {
return func() (chan<- string, <-chan error) {
_, _, driver := memory.Start(f.MaxMemory, f.Expiration)
ctrl, status, _ := httpserver.Start(api.HTTPHandler(driver), f.Config)
conf := api.Config{ConnectionLimit: f.ConnectionLimit}
conf.SetDriver(driver)
ctrl, status, _ := httpserver.Start(api.HTTPHandler(conf), f.Config)
return ctrl, status
}
}
@@ -58,7 +60,9 @@ type FilesystemFactory struct {
func (f FilesystemFactory) GetStartServerFunc() StartServerFunc {
return func() (chan<- string, <-chan error) {
_, _, driver := fs.Start(f.Path)
ctrl, status, _ := httpserver.Start(api.HTTPHandler(driver), f.Config)
conf := api.Config{ConnectionLimit: f.ConnectionLimit}
conf.SetDriver(driver)
ctrl, status, _ := httpserver.Start(api.HTTPHandler(conf), f.Config)
return ctrl, status
}
}
@@ -86,7 +90,9 @@ type DonutFactory struct {
func (f DonutFactory) GetStartServerFunc() StartServerFunc {
return func() (chan<- string, <-chan error) {
_, _, driver := donut.Start(f.Paths)
ctrl, status, _ := httpserver.Start(api.HTTPHandler(driver), f.Config)
conf := api.Config{ConnectionLimit: f.ConnectionLimit}
conf.SetDriver(driver)
ctrl, status, _ := httpserver.Start(api.HTTPHandler(conf), f.Config)
return ctrl, status
}
}