diff options
author | adamw <adam@warski.org> | 2017-10-12 19:23:09 +0200 |
---|---|---|
committer | adamw <adam@warski.org> | 2017-10-12 19:23:09 +0200 |
commit | 7bf4d02da823c21b27cf20ba0b764b511ac69432 (patch) | |
tree | 04b9ab557c4af82b9970af386e6f4f9e4292e472 /docs/backends/custom.rst | |
parent | 7885188a982c193e26f8ca6bc9aea8f6a642b32d (diff) | |
download | sttp-7bf4d02da823c21b27cf20ba0b764b511ac69432.tar.gz sttp-7bf4d02da823c21b27cf20ba0b764b511ac69432.tar.bz2 sttp-7bf4d02da823c21b27cf20ba0b764b511ac69432.zip |
More docs
Diffstat (limited to 'docs/backends/custom.rst')
-rw-r--r-- | docs/backends/custom.rst | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/backends/custom.rst b/docs/backends/custom.rst new file mode 100644 index 0000000..86d750a --- /dev/null +++ b/docs/backends/custom.rst @@ -0,0 +1,19 @@ +Custom backends, logging, metrics +================================= + +It is also entirely possible to write your own backend (if so, please consider +contributing!) or wrapping an existing one. You can even write completely +generic wrappers for any delegate backend, as each backend comes equipped +with a monad for the response type. This brings the possibility to ``map`` and +``flatMap`` over responses. + +Possible use-cases for wrapper-backend include: + +* logging +* capturing metrics +* request signing (transforming the request before sending it to the delegate) + +To pass some context to wrapper-backends, requests can be *tagged*. Each +``RequestT`` instance contains a ``tags: Map[String, Any]`` field. This is unused +by http, but can be used e.g. to pass a metric name or logging context. + |