diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1dbefca..6c2a6c1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,7 +4,7 @@ * Changed exception handling * now exceptions are chained (before they were added in `args`) * timeout errors are now chained (before they were not included at all) - * in case of dopiling, all callers are now notified about the error + * in case of dopiling, all callers are now notified about the error (see issue #23) 1.2.1 ----- diff --git a/examples/basic/_fix_case_to_be_removed.py b/examples/basic/_fix_case_to_be_removed.py deleted file mode 100644 index db5b3ae..0000000 --- a/examples/basic/_fix_case_to_be_removed.py +++ /dev/null @@ -1,42 +0,0 @@ -import asyncio - -from memoize import memoize_configuration - -# needed if one has tornado installed (could be removed otherwise) -memoize_configuration.force_asyncio = True - -from datetime import timedelta -from memoize.wrapper import memoize -from memoize.configuration import MutableCacheConfiguration -from memoize.entrybuilder import ProvidedLifeSpanCacheEntryBuilder -from memoize.eviction import NoEvictionStrategy -from memoize.key import EncodedMethodReferenceAndArgsKeyExtractor -from memoize.storage import LocalInMemoryCacheStorage -from asyncio import sleep, gather - - -@memoize(configuration=MutableCacheConfiguration( - configured=True, - storage=LocalInMemoryCacheStorage(), - key_extractor=EncodedMethodReferenceAndArgsKeyExtractor(), - method_timeout=timedelta(hours=1), - entry_builder=ProvidedLifeSpanCacheEntryBuilder(update_after=timedelta(hours=1), expire_after=timedelta(hours=1)), - eviction_strategy=NoEvictionStrategy(), -)) -async def test(): - await sleep(1) - raise ValueError("something went wrong") - - -async def main(): - results = await gather(test(), test(), test(), test(), return_exceptions=True) - for result in results: - print(result) - print(result.__cause__) - - # see nice traceback in the console - await test() - - -if __name__ == "__main__": - asyncio.get_event_loop().run_until_complete(main())