mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
performance close to handlers if no bindings but even if bindings except service (new feature is that we can bind functions as well) is x1.1 faster than the previous mvc implementation - make BaseController (so and C) optionally but not break the existing APIs that using iris.C or mvc.C
Former-commit-id: a26a8f836894c061e0f435df8ac1c2c534f0ee48
This commit is contained in:
@@ -37,8 +37,8 @@ func (e *Engine) Child() *Engine {
|
||||
child := New()
|
||||
|
||||
// copy the current parent's ctx func binders and services to this new child.
|
||||
if l := len(e.Input); l > 0 {
|
||||
input := make([]reflect.Value, l, l)
|
||||
if n := len(e.Input); n > 0 {
|
||||
input := make([]reflect.Value, n, n)
|
||||
copy(input, e.Input)
|
||||
child.Input = input
|
||||
}
|
||||
@@ -54,7 +54,7 @@ func (e *Engine) Handler(handler interface{}) context.Handler {
|
||||
return h
|
||||
}
|
||||
|
||||
func (e *Engine) Controller(router router.Party, controller BaseController, onActivate ...func(*ControllerActivator)) {
|
||||
func (e *Engine) Controller(router router.Party, controller interface{}, onActivate ...func(*ControllerActivator)) {
|
||||
ca := newControllerActivator(router, controller, e.Input...)
|
||||
|
||||
// give a priority to the "onActivate"
|
||||
|
||||
Reference in New Issue
Block a user