1========= 2Changelog 3========= 4 5.. changelog:: 6 :version: 0.9.2 7 :released: Mon May 4 2020 8 9 .. change:: 10 :tags: bug, installation 11 :tickets: 178 12 13 Ensured that the "pyproject.toml" file is not included in builds, as the 14 presence of this file indicates to pip that a pep-517 installation process 15 should be used. As this mode of operation appears to be not well supported 16 by current tools / distros, these problems are avoided within the scope of 17 dogpile.cache installation by omitting the file. 18 19 20.. changelog:: 21 :version: 0.9.1 22 :released: Wed Apr 29 2020 23 24 .. change:: 25 :tags: bug, tests 26 27 Added ``decorator`` module as a required testing dependency to 28 ``tox.ini`` so that tests work when this is not pre-installed. 29 30 .. change:: 31 :tags: bug, redis 32 :tickets: 171 33 34 Added option to the Redis backend 35 :paramref:`.RedisBackend.thread_local_lock`, which when set to False will 36 disable the use of a threading local by the ``redis`` module in its 37 distributed lock service, which is known to interfere with the lock's 38 behavior when used in an "async" use case, within dogpile this would be 39 when using the :paramref:`.CacheRegion.async_creation_runner` feature. The 40 default is conservatively being left at True, but it's likely this should 41 be set to False in all cases, so a warning is emitted if this flag is not 42 set to False in conjunction with the distributed lock. Added an optional 43 argument to :class:`.RedisBackend` that specifies whether or not a 44 thread-local Redis lock should be used. This is the default, but it breaks 45 asynchronous runner compatibility. 46 47.. changelog:: 48 :version: 0.9.0 49 :released: Mon Oct 28 2019 50 51 .. change:: 52 :tags: feature 53 54 Added logging facililities into :class:`.CacheRegion`, to indicate key 55 events such as cache keys missing or regeneration of values. As these can 56 be very high volume log messages, ``logging.DEBUG`` is used as the log 57 level for the events. Pull request courtesy Stéphane Brunner. 58 59 60 61.. changelog:: 62 :version: 0.8.0 63 :released: Fri Sep 20 2019 64 65 .. change:: 66 :tags: bug, setup 67 :tickets: 157 68 69 Removed the "python setup.py test" feature in favor of a straight run of 70 "tox". Per Pypa / pytest developers, "setup.py" commands are in general 71 headed towards deprecation in favor of tox. The tox.ini script has been 72 updated such that running "tox" with no arguments will perform a single run 73 of the test suite against the default installed Python interpreter. 74 75 .. seealso:: 76 77 https://github.com/pypa/setuptools/issues/1684 78 79 https://github.com/pytest-dev/pytest/issues/5534 80 81 82 .. change:: 83 :tags: bug, py3k 84 :tickets: 154 85 86 Replaced the Python compatbility routines for ``getfullargspec()`` with a 87 fully vendored version from Python 3.3. Originally, Python was emitting 88 deprecation warnings for this function in Python 3.8 alphas. While this 89 change was reverted, it was observed that Python 3 implementations for 90 ``getfullargspec()`` are an order of magnitude slower as of the 3.4 series 91 where it was rewritten against ``Signature``. While Python plans to 92 improve upon this situation, SQLAlchemy projects for now are using a simple 93 replacement to avoid any future issues. 94 95 96 97 .. change:: 98 :tags: bug, installation 99 :tickets: 160 100 101 Pinned minimum version of Python decorator module at 4.0.0 (July, 2015) as 102 previous versions don't provide the API that dogpile is using. 103 104 .. change:: 105 :tags: bug, py3k 106 :tickets: 159 107 108 Fixed the :func:`.sha1_mangle_key` key mangler to coerce incoming Unicode 109 objects into bytes as is required by the Py3k version of this function. 110 111 112.. changelog:: 113 :version: 0.7.1 114 :released: Tue Dec 11 2018 115 116 .. change:: 117 :tags: bug, region 118 :tickets: 139 119 120 Fixed regression in 0.7.0 caused by :ticket:`136` where the assumed 121 arguments for the :paramref:`.CacheRegion.async_creation_runner` expanded to 122 include the new :paramref:`.CacheRegion.get_or_create.creator_args` 123 parameter, as it was not tested that the async runner would be implicitly 124 called with these arguments when the :meth:`.CacheRegion.cache_on_arguments` 125 decorator was used. The exact signature of ``async_creation_runner`` is 126 now restored to have the same arguments in all cases. 127 128 129.. changelog:: 130 :version: 0.7.0 131 :released: Mon Dec 10 2018 132 133 .. change:: 134 :tags: bug 135 :tickets: 137 136 137 The ``decorator`` module is now used when creating function decorators 138 within :meth:`.CacheRegion.cache_on_arguments` and 139 :meth:`.CacheRegion.cache_multi_on_arguments` so that function signatures 140 are preserved. Pull request courtesy ankitpatel96. 141 142 Additionally adds a small performance enhancement which is to avoid 143 internally creating a ``@wraps()`` decorator for the creator function on 144 every get operation, by allowing the arguments to the creator be passed 145 separately to :meth:`.CacheRegion.get_or_create`. 146 147 148 .. change:: 149 :tags: bug, py3k 150 :tickets: 129 151 152 Fixed all Python 3.x deprecation warnings including 153 ``inspect.getargspec()``. 154 155.. changelog:: 156 :version: 0.6.8 157 :released: Sat Nov 24 2018 158 159 .. change:: 160 :tags: change 161 162 Project hosting has moved to GitHub, under the SQLAlchemy 163 organization at https://github.com/sqlalchemy/dogpile.cache 164 165.. changelog:: 166 :version: 0.6.7 167 :released: Thu Jul 26 2018 168 169 .. change:: 170 :tags: bug 171 :tickets: 128 172 173 Fixed issue in the :meth:`.CacheRegion.get_or_create_multi` method which 174 was erroneously considering the cached value as the timestamp field if the 175 :meth:`.CacheRegion.invalidate` method had ben used, usually causing a 176 ``TypeError`` to occur, or in less frequent cases an invalid result for 177 whether or not the cached value was invalid, leading to excessive caching 178 or regeneration. The issue was a regression caused by an implementation 179 issue in the pluggable invalidation feature added in :ticket:`38`. 180 181.. changelog:: 182 :version: 0.6.6 183 :released: Wed Jun 27 2018 184 185 .. change:: 186 :tags: feature 187 :tickets: 123 188 189 Added method :attr:`.CacheRegion.actual_backend` which calculates and 190 caches the actual backend for the region, which may be abstracted by 191 the use of one or more :class:`.ProxyBackend` subclasses. 192 193 194 195 196 .. change:: 197 :tags: bug 198 :tickets: 122 199 200 Fixed a condition in the :class:`.Lock` where the "get" function could be 201 called a second time unnecessarily, when returning an existing, expired 202 value from the cache. 203 204.. changelog:: 205 :version: 0.6.5 206 :released: Mon Mar 5 2018 207 208 .. change:: 209 :tags: bug 210 :tickets: 119 211 212 Fixed import issue for Python 3.7 where several variables named "async" 213 were, leading to syntax errors. Pull request courtesy Brian Sheldon. 214 215 216 217.. changelog:: 218 :version: 0.6.4 219 :released: Mon Jun 26, 2017 220 221 .. change:: 222 :tags: bug 223 224 The method :meth:`.Region.get_or_create_multi` will not pass to the 225 cache backend if no values are ultimately to be stored, based on 226 the use of the :paramref:`.Region.get_or_create_multi.should_cache_fn` 227 function. This empty dictionary is unnecessary and can cause API 228 problems for backends like that of Redis. Pull request courtesy 229 Tobias Sauerwein. 230 231 .. change:: 232 :tags: bug 233 234 The :attr:`.api.NO_VALUE` constant now has a fixed ``__repr__()`` 235 output, so that scenarios where this constant's string value 236 ends up being used as a cache key do not create multiple values. 237 Pull request courtesy Paul Brown. 238 239 .. change:: 240 :tags: bug 241 242 A new exception class :class:`.exception.PluginNotFound` is now 243 raised when a particular cache plugin class cannot be located 244 either as a setuptools entrypoint or as a registered backend. 245 Previously, a plain ``Exception`` was thrown. Pull request 246 courtesy Jamie Lennox. 247 248.. changelog:: 249 :version: 0.6.3 250 :released: Thu May 18, 2017 251 252 .. change:: 253 :tags: feature 254 255 Added ``replace_existing_backend`` to 256 :meth:`.CacheRegion.configure_from_config`. 257 Pull request courtesy Daniel Kraus. 258 259.. changelog:: 260 :version: 0.6.2 261 :released: Tue Aug 16 2016 262 263 .. change:: 264 :tags: feature 265 :tickets: 38 266 267 Added a new system to allow custom plugins specific to the issue of 268 "invalidate the entire region", using a new base class 269 :class:`.RegionInvalidationStrategy`. As there are many potential 270 strategies to this (special backend function, storing special keys, etc.) 271 the mechanism for both soft and hard invalidation is now customizable. 272 New approaches to region invalidation can be contributed as documented 273 recipes. Pull request courtesy Alexander Makarov. 274 275 .. change:: 276 :tags: feature 277 :tickets: 43 278 279 Added a new cache key generator :func:`.kwarg_function_key_generator`, 280 which takes keyword arguments as well as positional arguments into 281 account when forming the cache key. 282 283 .. change:: 284 :tags: bug 285 286 Restored some more util symbols that users may have been relying upon 287 (although these were not necessarily intended as user-facing): 288 ``dogpile.cache.util.coerce_string_conf``, 289 ``dogpile.cache.util.KeyReentrantMutex``, 290 ``dogpile.cache.util.memoized_property``, 291 ``dogpile.cache.util.PluginLoader``, 292 ``dogpile.cache.util.to_list``. 293 294.. changelog:: 295 :version: 0.6.1 296 :released: Mon Jun 6 2016 297 298 .. change:: 299 :tags: bug 300 :tickets: 99 301 302 Fixed imports for ``dogpile.core`` restoring ``ReadWriteMutex`` 303 and ``NameRegistry`` into the base namespace, in addition to 304 ``dogpile.core.nameregistry`` and ``dogpile.core.readwrite_lock``. 305 306.. changelog:: 307 :version: 0.6.0 308 :released: Mon Jun 6 2016 309 310 .. change:: 311 :tags: feature 312 :tickets: 91 313 314 The ``dogpile.core`` library has been rolled in as part of the 315 ``dogpile.cache`` distribution. The configuration of the ``dogpile`` 316 name as a namespace package is also removed from ``dogpile.cache``. 317 In order to allow existing installations of ``dogpile.core`` as a separate 318 package to remain unaffected, the ``.core`` package has been retired 319 within ``dogpile.cache`` directly; the :class:`.Lock` class is now 320 available directly as ``dogpile.Lock`` and the additional ``dogpile.core`` 321 constructs are under the ``dogpile.util`` namespace. 322 323 Additionally, the long-deprecated ``dogpile.core.Dogpile`` and 324 ``dogpile.core.SyncReaderDogpile`` classes have been removed. 325 326 .. change:: 327 :tags: bug 328 329 The Redis backend now creates a copy of the "arguments" dictionary passed 330 to it, before popping values out of it. This prevents the given 331 dictionary from losing its keys. 332 333 .. change:: 334 :tags: bug 335 :tickets: 97 336 337 Fixed bug in "null" backend where :class:`.NullLock` did not 338 accept a flag for the :meth:`.NullLock.acquire` method, nor did 339 it return a boolean value for "success". 340 341.. changelog:: 342 :version: 0.5.7 343 :released: Mon Oct 19 2015 344 345 .. change:: 346 :tags: feature 347 :pullreq: 37 348 :tickets: 54 349 350 Added new parameter :paramref:`.GenericMemcachedBackend.lock_timeout`, 351 used in conjunction with 352 :paramref:`.GenericMemcachedBackend.distributed_lock`, will specify the 353 timeout used when communicating to the ``.add()`` method of the memcached 354 client. Pull request courtesy Frits Stegmann and Morgan Fainberg. 355 356 .. change:: 357 :tags: feature 358 :pullreq: 35 359 :tickets: 65 360 361 Added a new flag :paramref:`.CacheRegion.configure.replace_existing_backend`, 362 allows a region to have a new backend replace an existing one. 363 Pull request courtesy hbccbh. 364 365 .. change:: 366 :tags: feature, tests 367 :pullreq: 33 368 369 Test suite now runs using py.test. Pull request courtesy 370 John Anderson. 371 372 .. change:: 373 :tags: bug, redis 374 :tickets: 74 375 376 Repaired the :meth:`.CacheRegion.get_multi` method when used with a 377 list of zero length against the redis backend. 378 379.. changelog:: 380 :version: 0.5.6 381 :released: Mon Feb 2 2015 382 383 .. change:: 384 :tags: feature 385 :pullreq: 30 386 387 Changed the pickle protocol for the file/DBM backend to 388 ``pickle.HIGHEST_PROTOCOL`` when producing new pickles, 389 to match that of the redis and memorypickle backends. 390 Pull request courtesy anentropic. 391 392.. changelog:: 393 :version: 0.5.5 394 :released: Wed Jan 21 2015 395 396 .. change:: 397 :tags: feature 398 :pullreq: 26 399 400 Added new arguments 401 :paramref:`.CacheRegion.cache_on_arguments.function_key_generator` and 402 :paramref:`.CacheRegion.cache_multi_on_arguments.function_multi_key_generator` 403 which serve as per-decorator replacements for the region-wide 404 :paramref:`.CacheRegion.function_key_generator` and 405 :paramref:`.CacheRegion.function_multi_key_generator` parameters, 406 respectively, so that custom key production schemes can be applied 407 on a per-function basis within one region. 408 Pull request courtesy Hongbin Lu. 409 410 .. change:: 411 :tags: bug 412 :tickets: 71 413 :pullreq: 25 414 415 Fixed bug where sending -1 for the 416 :paramref:`.CacheRegion.get_or_create.expiration_time` parameter to 417 :meth:`.CacheRegion.get_or_create` or 418 :meth:`.CacheRegion.get_or_create_multi` 419 would fail to honor the setting as "no expiration time". Pull request 420 courtesy Hongbin Lu. 421 422 .. change:: 423 :tags: bug 424 :tickets: 41 425 :pullreq: 28 426 427 The ``wrap`` argument is now propagated when calling 428 :meth:`.CacheRegion.configure_from_config`. Pull request courtesy 429 Jonathan Vanasco. 430 431 .. change:: 432 :tags: bug 433 434 Fixed tests under py.test, which were importing a symbol from 435 pytest itself ``is_unittest`` which has been removed. 436 437.. changelog:: 438 :version: 0.5.4 439 :released: Sat Jun 14 2014 440 441 .. change:: 442 :tags: feature 443 :pullreq: 18 444 445 Added new :class:`.NullBackend`, for testing and cache-disabling 446 purposes. Pull request courtesy Wichert Akkerman. 447 448 .. change:: 449 :tags: bug 450 :pullreq: 19 451 452 Added missing Mako test dependency to setup.py. 453 Pull request courtesy Wichert Akkerman. 454 455 .. change:: 456 :tags: bug 457 :tickets: 58 458 :pullreq: 20 459 460 Fixed bug where calling :meth:`.CacheRegion.get_multi` or 461 :meth:`.CacheRegion.set_multi` with an empty list would cause failures 462 based on backend. Pull request courtesy Wichert Akkerman. 463 464 .. change:: 465 :tags: feature 466 :pullreq: 17 467 468 Added new :paramref:`.RedisBackend.connection_pool` option 469 on the Redis backend; this can be passed a ``redis.ConnectionPool`` 470 instance directly. Pull request courtesy Masayuko. 471 472 .. change:: 473 :tags: feature 474 :pullreq: 16 475 476 Added new :paramref:`.RedisBackend.socket_timeout` option 477 on the Redis backend. Pull request courtesy 478 Saulius Menkevičius. 479 480 .. change:: 481 :tags: feature 482 483 Added support for tests to run via py.test. 484 485 .. change:: 486 :tags: bug 487 :pullreq: 15 488 489 Repaired the entry point for Mako templates; the name of the entrypoint 490 itself was wrong vs. what was in the docs, but beyond that the entrypoint 491 would load the wrong module name. Pull request courtesy zoomorph. 492 493 .. change:: 494 :tags: bug 495 :tickets: 57 496 :pullreq: 13 497 498 The :func:`.coerce_string_conf` function, which is used by 499 :meth:`.Region.configure_from_config`, will now recognize floating point 500 values when parsing conf strings and deliver them as such; this supports 501 non-integer values such as Redis ``lock_sleep``. Pullreq courtesy 502 Jeff Dairiki. 503 504.. changelog:: 505 :version: 0.5.3 506 :released: Wed Jan 8 2014 507 508 .. change:: 509 :tags: bug 510 :pullreq: 10 511 512 Fixed bug where the key_mangler would get in the way of usage of the 513 async_creation_runner feature within the :meth:`.Region.get_or_create` 514 method, by sending in the mangled key instead of the original key. The 515 "mangled" key is only supposed to be exposed within the backend storage, 516 not the creation function which sends the key back into the :meth:`.Region.set`, 517 which does the mangling itself. Pull request courtesy Ryan Kolak. 518 519 .. change:: 520 :tags: bug, py3k 521 522 Fixed bug where the :meth:`.Region.get_multi` method wasn't calling 523 the backend correctly in Py3K (e.g. was passing a destructive ``map()`` 524 object) which would cause this method to fail on the memcached backend. 525 526 .. change:: 527 :tags: feature 528 :tickets: 55 529 530 Added a ``get()`` method to complement the ``set()``, ``invalidate()`` 531 and ``refresh()`` methods established on functions decorated by 532 :meth:`.CacheRegion.cache_on_arguments` and 533 :meth:`.CacheRegion.cache_multi_on_arguments`. Pullreq courtesy 534 Eric Hanchrow. 535 536 .. change:: 537 :tags: feature 538 :tickets: 51 539 :pullreq: 11 540 541 Added a new variant on :class:`.MemoryBackend`, :class:`.MemoryPickleBackend`. 542 This backend applies ``pickle.dumps()`` and ``pickle.loads()`` to cached 543 values upon set and get, so that similar copy-on-cache behavior as that 544 of other backends is employed, guarding cached values against subsequent 545 in-memory state changes. Pullreq courtesy Jonathan Vanasco. 546 547 .. change:: 548 :tags: bug 549 :pullreq: 9 550 551 Fixed a format call in the redis backend which would otherwise fail 552 on Python 2.6; courtesy Jeff Dairiki. 553 554.. changelog:: 555 :version: 0.5.2 556 :released: Fri Nov 15 2013 557 558 .. change:: 559 :tags: bug 560 561 Fixes to routines on Windows, including that default unit tests pass, 562 and an adjustment to the "soft expiration" feature to ensure the 563 expiration works given windows time.time() behavior. 564 565 .. change:: 566 :tags: bug 567 568 Added py2.6 compatibility for unsupported ``total_seconds()`` call 569 in region.py 570 571 .. change:: 572 :tags: feature 573 :tickets: 44 574 575 Added a new argument ``lock_factory`` to the :class:`.DBMBackend` 576 implementation. This allows for drop-in replacement of the default 577 :class:`.FileLock` backend, which builds on ``os.flock()`` and only 578 supports Unix platforms. A new abstract base :class:`.AbstractFileLock` 579 has been added to provide a common base for custom lock implementations. 580 The documentation points to an example thread-based rw lock which is 581 now tested on Windows. 582 583.. changelog:: 584 :version: 0.5.1 585 :released: Thu Oct 10 2013 586 587 .. change:: 588 :tags: feature 589 :tickets: 38 590 591 The :meth:`.CacheRegion.invalidate` method now supports an option 592 ``hard=True|False``. A "hard" invalidation, equivalent to the 593 existing functionality of :meth:`.CacheRegion.invalidate`, means 594 :meth:`.CacheRegion.get_or_create` will not return the "old" value at 595 all, forcing all getters to regenerate or wait for a regeneration. 596 "soft" invalidation means that getters can continue to return the 597 old value until a new one is generated. 598 599 .. change:: 600 :tags: feature 601 :tickets: 40 602 603 New dogpile-specific exception classes have been added, so that 604 issues like "region already configured", "region unconfigured", 605 raise dogpile-specific exceptions. Other exception classes have 606 been made more specific. Also added new accessor 607 :attr:`.CacheRegion.is_configured`. Pullreq courtesy Morgan Fainberg. 608 609 .. change:: 610 :tags: bug 611 612 Erroneously missed when the same change was made for ``set()`` 613 in 0.5.0, the Redis backend now uses ``pickle.HIGHEST_PROTOCOL`` 614 for the ``set_multi()`` method as well when producing pickles. 615 Courtesy Łukasz Fidosz. 616 617 .. change:: 618 :tags: bug, redis, py3k 619 :tickets: 39 620 621 Fixed an errant ``u''`` causing incompatibility in Python3.2 622 in the Redis backend, courtesy Jimmey Mabey. 623 624 .. change:: 625 :tags: bug 626 627 The :func:`.util.coerce_string_conf` method now correctly coerces 628 negative integers and those with a leading + sign. This previously 629 prevented configuring a :class:`.CacheRegion` with an ``expiration_time`` 630 of ``'-1'``. Courtesy David Beitey. 631 632 .. change:: 633 :tags: bug 634 635 The ``refresh()`` method on :meth:`.CacheRegion.cache_multi_on_arguments` 636 now supports the ``asdict`` flag. 637 638.. changelog:: 639 :version: 0.5.0 640 :released: Fri Jun 21 2013 641 642 .. change:: 643 :tags: misc 644 645 Source repository has been moved to git. 646 647 .. change:: 648 :tags: bug 649 650 The Redis backend now uses ``pickle.HIGHEST_PROTOCOL`` when 651 producing pickles. Courtesy Lx Yu. 652 653 .. change:: 654 :tags: bug 655 656 :meth:`.CacheRegion.cache_on_arguments` now has a new argument 657 ``to_str``, defaults to ``str()``. Can be replaced with ``unicode()`` 658 or other functions to support caching of functions that 659 accept non-unicode arguments. Initial patch courtesy Lx Yu. 660 661 .. change:: 662 :tags: feature 663 664 Now using the ``Lock`` included with the Python 665 ``redis`` backend, which adds ``lock_timeout`` 666 and ``lock_sleep`` arguments to the :class:`.RedisBackend`. 667 668 .. change:: 669 :tags: feature 670 :tickets: 33, 35 671 672 Added new methods :meth:`.CacheRegion.get_or_create_multi` 673 and :meth:`.CacheRegion.cache_multi_on_arguments`, which 674 make use of the :meth:`.CacheRegion.get_multi` and similar 675 functions to store and retrieve multiple keys at once while 676 maintaining dogpile semantics for each. 677 678 .. change:: 679 :tags: feature 680 :tickets: 36 681 682 Added a method ``refresh()`` to functions decorated by 683 :meth:`.CacheRegion.cache_on_arguments` and 684 :meth:`.CacheRegion.cache_multi_on_arguments`, to complement 685 ``invalidate()`` and ``set()``. 686 687 .. change:: 688 :tags: feature 689 :tickets: 13 690 691 :meth:`.CacheRegion.configure` accepts an 692 optional ``datetime.timedelta`` object 693 for the ``expiration_time`` argument as well 694 as an integer, courtesy Jack Lutz. 695 696 .. change:: 697 :tags: feature 698 :tickets: 20 699 700 The ``expiration_time`` argument passed to 701 :meth:`.CacheRegion.cache_on_arguments` 702 may be a callable, to return a dynamic 703 timeout value. Courtesy David Beitey. 704 705 .. change:: 706 :tags: feature 707 :tickets: 26 708 709 Added support for simple augmentation of existing 710 backends using the :class:`.ProxyBackend` class. 711 Thanks to Tim Hanus for the great effort with 712 development, testing, and documentation. 713 714 .. change:: 715 :tags: feature 716 :pullreq: 14 717 718 Full support for multivalue get/set/delete 719 added, using :meth:`.CacheRegion.get_multi`, 720 :meth:`.CacheRegion.set_multi`, :meth:`.CacheRegion.delete_multi`, 721 courtesy Marcos Araujo Sobrinho. 722 723 .. change:: 724 :tags: bug 725 :tickets: 27 726 727 Fixed bug where the "name" parameter for 728 :class:`.CacheRegion` was ignored entirely. 729 Courtesy Wichert Akkerman. 730 731.. changelog:: 732 :version: 0.4.3 733 :released: Thu Apr 4 2013 734 735 .. change:: 736 :tags: bug 737 738 Added support for the ``cache_timeout`` Mako 739 argument to the Mako plugin, which will pass 740 the value to the ``expiration_time`` argument 741 of :meth:`.CacheRegion.get_or_create`. 742 743 .. change:: 744 :tags: feature 745 :pullreq: 13 746 747 :meth:`.CacheRegion.get_or_create` and 748 :meth:`.CacheRegion.cache_on_arguments` now accept a new 749 argument ``should_cache_fn``, receives the value 750 returned by the "creator" and then returns True or 751 False, where True means "cache plus return", 752 False means "return the value but don't cache it." 753 754.. changelog:: 755 :version: 0.4.2 756 :released: Sat Jan 19 2013 757 758 .. change:: 759 :tags: feature 760 :pullreq: 10 761 762 An "async creator" function can be specified to 763 :class:`.CacheRegion` which allows the "creation" function 764 to be called asynchronously or be subsituted for 765 another asynchronous creation scheme. Courtesy 766 Ralph Bean. 767 768.. changelog:: 769 :version: 0.4.1 770 :released: Sat Dec 15 2012 771 772 .. change:: 773 :tags: feature 774 :pullreq: 9 775 776 The function decorated by :meth:`.CacheRegion.cache_on_arguments` 777 now includes a ``set()`` method, in addition to the existing 778 ``invalidate()`` method. Like ``invalidate()``, it accepts 779 a set of function arguments, but additionally accepts as the 780 first positional argument a new value to place in the cache, 781 to take the place of that key. Courtesy Antoine Bertin. 782 783 .. change:: 784 :tags: bug 785 :tickets: 15 786 787 Fixed bug in DBM backend whereby if an error occurred 788 during the "write" operation, the file lock, if enabled, 789 would not be released, thereby deadlocking the app. 790 791 .. change:: 792 :tags: bug 793 :tickets: 12 794 795 The :func:`.util.function_key_generator` used by the 796 function decorator no longer coerces non-unicode 797 arguments into a Python unicode object on Python 2.x; 798 this causes failures on backends such as DBM which 799 on Python 2.x apparently require bytestrings. The 800 key_mangler is still needed if actual unicode arguments 801 are being used by the decorated function, however. 802 803 .. change:: 804 :tags: feature 805 806 Redis backend now accepts optional "url" argument, 807 will be passed to the new ``StrictRedis.from_url()`` 808 method to determine connection info. Courtesy 809 Jon Rosebaugh. 810 811 .. change:: 812 :tags: feature 813 814 Redis backend now accepts optional "password" 815 argument. Courtesy Jon Rosebaugh. 816 817 .. change:: 818 :tags: feature 819 820 DBM backend has "fallback" when calling dbm.get() to 821 instead use dictionary access + KeyError, in the case 822 that the "gdbm" backend is used which does not include 823 .get(). Courtesy Jon Rosebaugh. 824 825.. changelog:: 826 :version: 0.4.0 827 :released: Tue Oct 30 2012 828 829 .. change:: 830 :tags: bug 831 :tickets: 1 832 833 Using dogpile.core 0.4.0 now, fixes a critical 834 bug whereby dogpile pileup could occur on first value 835 get across multiple processes, due to reliance upon 836 a non-shared creation time. This is a dogpile.core 837 issue. 838 839 .. change:: 840 :tags: bug 841 :tickets: 842 843 Fixed missing __future__ with_statement 844 directive in region.py. 845 846.. changelog:: 847 :version: 0.3.1 848 :released: Tue Sep 25 2012 849 850 .. change:: 851 :tags: bug 852 :tickets: 853 854 Fixed the mako_cache plugin which was not yet 855 covered, and wasn't implementing the mako plugin 856 API correctly; fixed docs as well. Courtesy 857 Ben Hayden. 858 859 .. change:: 860 :tags: bug 861 :tickets: 862 863 Fixed setup so that the tests/* directory 864 isn't yanked into the install. Courtesy Ben Hayden. 865 866.. changelog:: 867 :version: 0.3.0 868 :released: Thu Jun 14 2012 869 870 .. change:: 871 :tags: feature 872 :tickets: 873 874 get() method now checks expiration time 875 by default. Use ignore_expiration=True 876 to bypass this. 877 878 .. change:: 879 :tags: feature 880 :tickets: 7 881 882 Added new invalidate() method. Sets the current 883 timestamp as a minimum value that all retrieved 884 values must be created after. Is honored by the 885 get_or_create() and get() methods. 886 887 .. change:: 888 :tags: bug 889 :tickets: 8 890 891 Fixed bug whereby region.get() didn't 892 work if the value wasn't present. 893 894 895 896.. changelog:: 897 :version: 0.2.4 898 :released: 899 900 .. change:: 901 :tags: 902 :tickets: 903 904 Fixed py3k issue with config string coerce, 905 courtesy Alexander Fedorov 906 907.. changelog:: 908 :version: 0.2.3 909 :released: Wed May 16 2012 910 911 .. change:: 912 :tags: 913 :tickets: 3 914 915 support "min_compress_len" and "memcached_expire_time" 916 with python-memcached backend. Tests courtesy 917 Justin Azoff 918 919 .. change:: 920 :tags: 921 :tickets: 4 922 923 Add support for coercion of string config values 924 to Python objects - ints, "false", "true", "None". 925 926 .. change:: 927 :tags: 928 :tickets: 5 929 930 Added support to DBM file lock to allow reentrant 931 access per key within a single thread, so that 932 even though the DBM backend locks for the whole file, 933 a creation function that calls upon a different 934 key in the cache can still proceed. 935 936 .. change:: 937 :tags: 938 :tickets: 939 940 Fixed DBM glitch where multiple readers 941 could be serialized. 942 943 .. change:: 944 :tags: 945 :tickets: 946 947 Adjust bmemcached backend to work with newly-repaired 948 bmemcached calling API (see bmemcached 949 ef206ed4473fec3b639e). 950 951.. changelog:: 952 :version: 0.2.2 953 :released: Thu Apr 19 2012 954 955 .. change:: 956 :tags: 957 :tickets: 958 959 add Redis backend, courtesy Ollie Rutherfurd 960 961.. changelog:: 962 :version: 0.2.1 963 :released: Sun Apr 15 2012 964 965 .. change:: 966 :tags: 967 :tickets: 968 969 move tests into tests/cache namespace 970 971 .. change:: 972 :tags: 973 :tickets: 974 975 py3k compatibility is in-place now, no 976 2to3 needed. 977 978.. changelog:: 979 :version: 0.2.0 980 :released: Sat Apr 14 2012 981 982 .. change:: 983 :tags: 984 :tickets: 985 986 Based on dogpile.core now, to get the package 987 namespace thing worked out. 988 989 990 991.. changelog:: 992 :version: 0.1.1 993 :released: Tue Apr 10 2012 994 995 .. change:: 996 :tags: 997 :tickets: 998 999 Fixed the configure_from_config() method of region 1000 and backend which wasn't working. Courtesy 1001 Christian Klinger. 1002 1003.. changelog:: 1004 :version: 0.1.0 1005 :released: Sun Apr 08 2012 1006 1007 .. change:: 1008 :tags: 1009 :tickets: 1010 1011 Initial release. 1012 1013 .. change:: 1014 :tags: 1015 :tickets: 1016 1017 Includes a pylibmc backend and a plain dictionary backend. 1018 1019