最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - No sharing cache, using IMemoryCache - Stack Overflow

programmeradmin1浏览0评论

My api depends on some programs that are expensive to start up for each call. I am trying to inject a cache that contains the cached objects wrapping the programs so they can be reused without killing executables between calls to my api.

Before trying to use a cache each call would start up their own instance of a program and run, which is important as it is wrapped COBOL programs with static variables.

My problem is that I'm not sure how I use the cache such that the cached objects are exclusive while used by a call. I want another program to be started up if another call has already hit the cache with the same key and is still using that value. Would be great if I can somehow build up a pool as needed for each program, some a used a lot, some rarely.

发布评论

评论列表(0)

  1. 暂无评论