inaka / cowboy-trails

A couple of improvements over Cowboy Routes

Home Page:http://inaka.github.io/cowboy-trails/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ensure that the order how list of trails comes when call `trails:store/1` be the same when call `trails:all/0`.

cabol opened this issue · comments

Currently, when trails:store/1 is invoked, list of trails/routes are stored into an ETS table (in a set structure), so it breaks the order how routes comes in the list, and due to this trails:all/0 returns the list in different order.

One option could be use an ordered_set structure for ETS table, BUT will be necessary add an additional argument (for example a consecutive integer) in order that the tree can be sorted in the right way.