Closed nash8114 closed 1 year ago
@nash8114 hello, thanks for using angelo and sorry for the late reply. i hope to have time to look at your work this week.
some very basic initial profiling does show a drop off in handled requests per second on this branch. perhaps a more opt-in approach might be best.
This pull request has been stagnant as I've not been using angelo for a while.
I've added a "map" method for the Angelo::Base class, which will map an Angelo::Base class (or descendent thereof) to a path. The accompanying spec file describes it for the most part.
In this approach I've added the "mapped_module" routing directly in Angelo::Server#route! An alternative would be to use a specialized Router class object. This would save a little overhead on routing for all Angelo::Base objects. Another alternative would be to create a module which can be imported if routing is wanted (in which case the overhead increases only for the class on which it is imported)
Perhaps we can do some profiling to determine the benefits and cost of each approach.