aboutsummaryrefslogtreecommitdiff
path: root/docs/backends/start_stop.rst
diff options
context:
space:
mode:
authoradamw <adam@warski.org>2017-10-12 18:21:00 +0200
committeradamw <adam@warski.org>2017-10-12 18:21:00 +0200
commit7885188a982c193e26f8ca6bc9aea8f6a642b32d (patch)
tree3dc9af024fabf67716902709e98743111d004a97 /docs/backends/start_stop.rst
parent17967df3414c19bfc7bd726ba9b26312a3c76437 (diff)
downloadsttp-7885188a982c193e26f8ca6bc9aea8f6a642b32d.tar.gz
sttp-7885188a982c193e26f8ca6bc9aea8f6a642b32d.tar.bz2
sttp-7885188a982c193e26f8ca6bc9aea8f6a642b32d.zip
Docs: initial
Diffstat (limited to 'docs/backends/start_stop.rst')
-rw-r--r--docs/backends/start_stop.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/backends/start_stop.rst b/docs/backends/start_stop.rst
new file mode 100644
index 0000000..6cd6f13
--- /dev/null
+++ b/docs/backends/start_stop.rst
@@ -0,0 +1,17 @@
+Starting & cleaning up
+======================
+
+In case of most backends, you should only instantiate a backend once per
+application, as a backend typically allocates resources such as thread or
+connection pools.
+
+When ending the application, make sure to call ``backend.close()``, which will
+free up resources used by the backend (if any). The close process might be
+asynchronous, that is it can complete after the ``close()`` method returns.
+
+Note that only resources allocated by the backends are freed. For example,
+if you use the ``AkkaHttpBackend()`` the ``close()`` method will terminate the
+underlying actor system. However, if you have provided an existing actor system
+upon backend creation (``AkkaHttpBackend.usingActorSystem``), the ``close()``
+method will be a no-op.
+