首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > draagon过期缓存

draagon过期缓存

  • 资源大小:6.18 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分:1积分
  • 标      签: 缓存 Draagon

资 源 简 介

Draagon Expiring Cache This is a simple cache mechanism that uses an underlying ConcurrentHashMap and a CacheManager to expire cache entries based on a configurable amount of time. The CacheManager is single threaded and manages all Cache instances and is optimized for minimal processing time. The Cache object implements the Map interface for easy compatibility, simply replace your Map construction with a Cache object to get the expiring functionality. Usage ``` int TIMEOUT_SECONDS = 180; int CHECK_SECONDS = 30; Cache c = new Cache( TIMEOUTSECONDS, CHECKSECONDS ); c.put( "test", "me" ); assertTrue( c.get("test") != null ); Thread.sleep( 181000L ); assertTrue( c.get( "test") == null ); ``` Maven To include with Maven, use one or more of the following dependencies: com.draagon

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP