kenichi / angelo

Sinatra-like DSL for Reel that supports WebSockets and SSE
Other
303 stars 23 forks source link

Modular routing #80

Closed nash8114 closed 1 year ago

nash8114 commented 6 years ago

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.

kenichi commented 6 years 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.

kenichi commented 6 years ago

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.

nash8114 commented 1 year ago

This pull request has been stagnant as I've not been using angelo for a while.