3 ms·
This looks like the 'gateway service' architectural pattern, in which you put a thin layer in front of your API service in order to perform activities common to
by felixgallo 11y ago
This looks like the 'gateway service' architectural pattern, in which you put a thin layer in front of your API service in order to perform activities common to all calls, like logging, metrics, authentication, session management, etc.
It's a little unusual to put that in as a proxy in front of a gen_server, because normally intra-erlang messaging doesn't need those facilities, which are normally handled at the border. But for metrics I can see it.
- wcummings 11y agoErlang's debugger lets you trace messages, I wonder how it achieves this.
- jerf 11y agoVM-level support.
- gamache 11y agoYeah, I'm a little surprised this didn't illustrate the metrics gathering part, because aside from that, there isn't a lot to be gained from using this pattern.
- zsoci 11y agoWould have been too much for the blog. Here is the stats functionality described: https://github.com/sqor/CommonServiceInterface#statistic-functionality https://github.com/sqor/CommonServiceInterface#statistic-fun...
- zsoci 11y agoIn addition to statistics, handling requests parallel is also a common pattern CSI implements.
- pessimizer 11y agoYou could also use it for resource management, couldn't you? the csi server could handle calls differently based on reaction to the overview that it has. Not that you couldn't write something like this yourself without too much difficulty, but standardizing could mean not having to reinvent the wheel and might have some benefits for tooling?