DEV Community

Discussion on: PHP Package: Caller

Collapse
michaelgv profile image
Mike

It looks nice, but how does it save someone time when building a router?

Typically the router logic to find and invoke would be one time per controller, the autoloader would hunt, the router will effectively create new instance (within NS or without), trigger $controller->$method([...arguments...]), typically there should be lifecycle hooks on it as well. Most of the time if you’re using a cache like Redis, you can dump the object to the redis cluster, skip autoloading and hot-restore it with deserialization, and have it available faster than regular hunting.

Collapse
devmazee2057282 profile image
dewbiez Author

I don't know anything about lifecycle hooks. I'm not sure what you mean.