While working on Telegram/Slack/Messenger Bot, I was in need something similar to HTTP Router but for routing messages in order to eliminate creating huge state machine. httprouter was perfect match for this use case and changed some parts of it. This could be used not only for bots but for other things where routing is needed.
@julienschmidt, what are your thoughts on this? I think I'll be using @iahmedov's branch too, for custom routing scenarios. It'd be cool if this got into master.
Hi @julienschmidt,
While working on Telegram/Slack/Messenger Bot, I was in need something similar to HTTP Router but for routing messages in order to eliminate creating huge state machine. httprouter was perfect match for this use case and changed some parts of it. This could be used not only for bots but for other things where routing is needed.
Benchmark comparison shows slightly degraded performance in ns/operations. But allocations and memory usage hasn't changed
Here is the diff: https://github.com/julienschmidt/httprouter/compare/master...iahmedov:make_tree_public?diff=unified&name=master
Do we need this functionality in this main repo? If yes, I can open pull request.