-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated backends docs, caching and cookbook
- Loading branch information
Showing
5 changed files
with
124 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
.. _caching: | ||
|
||
Caching | ||
======= | ||
|
||
Arca can cache results of the tasks using `dogpile.cache <https://dogpilecache.readthedocs.io/en/latest/>`_. | ||
The default cache backend is ``dogpile.cache.null``, so no caching. | ||
|
||
You can setup caching with the backend setting ``ARCA_CACHE_BACKEND`` and all the arguments needed for setup can be set | ||
using ``ARCA_CACHE_BACKEND_ARGUMENTS`` which can either be a dict or a json string. | ||
|
||
Example setup: | ||
|
||
.. code-block:: python | ||
arca = Arca(settings={ | ||
"ARCA_CACHE_BACKEND": "dogpile.cache.redis", | ||
"ARCA_CACHE_BACKEND_ARGUMENTS": { | ||
"host": "localhost", | ||
"port": 6379, | ||
"db": 0, | ||
} | ||
}) | ||
To see all available cache backends and their settings, | ||
please visit the ``dogpile.cache`` `documentation <https://dogpilecache.readthedocs.io/en/latest/>`_. | ||
Some of the other backends might have other python dependencies. | ||
|
||
When ``Arca`` is being initialized, a check is made if the cache backend is writable and readable, | ||
which raises an ``arca.exceptions.ArcaMisconfigured`` if it's not. | ||
If the cache requires some python dependency :class:`ModuleNotFoundError` will be raised. | ||
If you wish to ignore these errors, ``ignore_cache_errors`` setting can be used. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
Settings | ||
======== | ||
|
||
.. _configuring: | ||
|
||
Configuring Arca | ||
---------------- | ||
|
||
|