8000 1.6.0 by 2018-11-27 · Pull Request #10 · gqylpy/funccache · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

1.6.0 #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 8, 2024
Merged

1.6.0 #10

merged 1 commit into from
Oct 8, 2024

Conversation

2018-11-27
Copy link
Member
  1. The scheme of reconstructing the return value of the cache function, uses the secondary lock. Solve the lock contention problem when the function is called concurrently with different parameters.
  2. The return value of the method in the cache class supports setting the expiration time.
  3. Add a decorator named count, supports caching the return value of a function by number of calls.
  4. The decorator with cache expiration expires is renamed to ttl.
  5. The cache expiration time parameter can be passed in unit-time (such as "1h40m").
  6. Fix issue: When an exception occurs in the call to the cached object, subsequent successive calls always raise KeyError: '__return__'. 当被缓存的对象调用出现异常后,后续的连续调用始终引发 KeyError: '__return__' #2
  7. Fix issue: Concurrent calls when the return value of the function has not been cached or has expired may repeat the execution of the function. 当函数返回值还未被缓存或已过期时的并发调用可能重复执行函数 #4
  8. The __getattribute__ method is no longer silently overridden, and an exception is thrown directly if it exists.
  9. Internal code adds type annotations, as well as a lot of optimization and refactoring.
  10. Refactor the internal method Time2Second to make it more concise and efficient.
  11. Use time.monotonic() to replace time.time() for cache expiration checks.
  12. Fix the potential errors that may occur in the class cache when running in performance mode.

  1. 重构缓存函数返回值的方案,现采用二级锁。解决以不同参数并发调用函数时的锁竞争问题。
  2. 缓存类中方法的返回值支持设置过期时间。
  3. 新增装饰器 count,支持按调用次数缓存函数的返回值。
  4. 带缓存有效期的装饰器 expires 更名为 ttl
  5. 缓存过期时间的参数支持按单位时间(如 "1h40m")的方式传入。
  6. 修复问题:当被缓存的对象调用出现异常后,后续的连续调用始终引发 KeyError: '__return__'当被缓存的对象调用出现异常后,后续的连续调用始终引发 KeyError: '__return__' #2
  7. 修复问题:当函数返回值还未被缓存或已过期时的并发调用可能重复执行函数。当函数返回值还未被缓存或已过期时的并发调用可能重复执行函数 #4
  8. 不再静默覆盖 __getattribute__ 方法,如果它存在,将直接抛出异常。
  9. 内部代码添加类型注解,以及大量优化和重构。
  10. 重构内部方法 Time2Second 使之更简洁和高效。
  11. 使用 time.monotonic() 替换 time.time() 进行缓存过期检查。
  12. 修复在性能模式下运行时类缓存器可能发生的错误。

1.The scheme of reconstructing the return value of the cache function, uses the secondary lock. Solve the lock contention problem when the function is called concurrently with different parameters.
2.The return value of the method in the cache class supports setting the expiration time.
3.Add a decorator named `count`, supports caching the return value of a function by number of calls.
4.The decorator with cache expiration `expires` is renamed to `ttl`.
5.The cache expiration time parameter can be passed in unit-time (such as "1h40m").
6.Fix issue: When an exception occurs in the call to the cached object, subsequent successive calls always raise `KeyError: '__return__'`. gqylpy#2
7.Fix issue: Concurrent calls when the return value of the function has not been cached or has expired may repeat the execution of the function. gqylpy#4
8.The `__getattribute__` method is no longer silently overridden, and an exception is thrown directly if it exists.
9.Internal code adds type annotations, as well as a lot of optimization and refactoring.
10.Refactor the internal method `Time2Second` to make it more concise and efficient.
11.Use `time.monotonic()` to replace `time.time()` for cache expiration checks.
12.Fix the potential errors that may occur in the class cache when running in performance mode.

1.重构缓存函数返回值的方案,现采用二级锁。解决以不同参数并发调用函数时的锁竞争问题。
2.缓存类中方法的返回值支持设置过期时间。
3.新增装饰器 `count`,支持按调用次数缓存函数的返回值。
4.带缓存有效期的装饰器 `expires` 更名为 `ttl`。
5.缓存过期时间的参数支持按单位时间(如 "1h40m")的方式传入。
6.修复问题:当被缓存的对象调用出现异常后,后续的连续调用始终引发 `KeyError: '__return__'`。gqylpy#2
7.修复问题:当函数返回值还未被缓存或已过期时的并发调用可能重复执行函数。gqylpy#4
8.不再静默覆盖 `__getattribute__` 方法,如果它存在,将直接抛出异常。
9.内部代码添加类型注解,以及大量优化和重构。
10.重构内部方法 `Time2Second` 使之更简洁和高效。
11.使用 `time.monotonic()` 替换 `time.time()` 进行缓存过期检查。
12.修复在性能模式下运行时类缓存器可能发生的错误。
@2018-11-27 2018-11-27 self-assigned this Oct 8, 2024
@2018-11-27 2018-11-27 merged commit 41e5a1f into gqylpy:v1.0 Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0