{"action":"created","issue":{"url":"https://api.github.com/repos/cappuccino/cappuccino/issues/2321","labels_url":"https://api.github.com/repos/cappuccino/cappuccino/issues/2321/labels{/name}","comments_url":"https://api.github.com/repos/cappuccino/cappuccino/issues/2321/comments","events_url":"https://api.github.com/repos/cappuccino/cappuccino/issues/2321/events","html_url":"https://github.com/cappuccino/cappuccino/pull/2321","id":59179522,"number":2321,"title":"New: added the CPCache class","user":{"login":"william57m","id":3273681,"avatar_url":"https://avatars.githubusercontent.com/u/3273681?v=3","gravatar_id":"","url":"https://api.github.com/users/william57m","html_url":"https://github.com/william57m","followers_url":"https://api.github.com/users/william57m/followers","following_url":"https://api.github.com/users/william57m/following{/other_user}","gists_url":"https://api.github.com/users/william57m/gists{/gist_id}","starred_url":"https://api.github.com/users/william57m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/william57m/subscriptions","organizations_url":"https://api.github.com/users/william57m/orgs","repos_url":"https://api.github.com/users/william57m/repos","events_url":"https://api.github.com/users/william57m/events{/privacy}","received_events_url":"https://api.github.com/users/william57m/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cappuccino/cappuccino/labels/%23accepted","name":"#accepted","color":"f4d372"},{"url":"https://api.github.com/repos/cappuccino/cappuccino/labels/%23needs-improvement","name":"#needs-improvement","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cappuccino/cappuccino/milestones/4","html_url":"https://github.com/cappuccino/cappuccino/milestones/Someday","labels_url":"https://api.github.com/repos/cappuccino/cappuccino/milestones/4/labels","id":107283,"number":4,"title":"Someday","description":"","creator":{"login":"aparajita","id":22218,"avatar_url":"https://avatars.githubusercontent.com/u/22218?v=3","gravatar_id":"","url":"https://api.github.com/users/aparajita","html_url":"https://github.com/aparajita","followers_url":"https://api.github.com/users/aparajita/followers","following_url":"https://api.github.com/users/aparajita/following{/other_user}","gists_url":"https://api.github.com/users/aparajita/gists{/gist_id}","starred_url":"https://api.github.com/users/aparajita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aparajita/subscriptions","organizations_url":"https://api.github.com/users/aparajita/orgs","repos_url":"https://api.github.com/users/aparajita/repos","events_url":"https://api.github.com/users/aparajita/events{/privacy}","received_events_url":"https://api.github.com/users/aparajita/received_events","type":"User","site_admin":false},"open_issues":97,"closed_issues":614,"state":"open","created_at":"2012-04-12T21:50:28Z","updated_at":"2015-03-03T16:34:39Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2015-02-27T02:18:47Z","updated_at":"2015-03-04T00:10:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cappuccino/cappuccino/pulls/2321","html_url":"https://github.com/cappuccino/cappuccino/pull/2321","diff_url":"https://github.com/cappuccino/cappuccino/pull/2321.diff","patch_url":"https://github.com/cappuccino/cappuccino/pull/2321.patch"},"body":"This is an implementation of NSCache https://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSCache_Class/index.html\r\nI tried to reproduct the default behaviour, but I had to give up the implementation of NSDiscardableContent, because Cappuccino don't provide a mechanism to count objects usage, so the property evictsObjectsWithDiscardedContent also disappear from my implementation."},"comment":{"url":"https://api.github.com/repos/cappuccino/cappuccino/issues/comments/77069117","html_url":"https://github.com/cappuccino/cappuccino/pull/2321#issuecomment-77069117","issue_url":"https://api.github.com/repos/cappuccino/cappuccino/issues/2321","id":77069117,"user":{"login":"william57m","id":3273681,"avatar_url":"https://avatars.githubusercontent.com/u/3273681?v=3","gravatar_id":"","url":"https://api.github.com/users/william57m","html_url":"https://github.com/william57m","followers_url":"https://api.github.com/users/william57m/followers","following_url":"https://api.github.com/users/william57m/following{/other_user}","gists_url":"https://api.github.com/users/william57m/gists{/gist_id}","starred_url":"https://api.github.com/users/william57m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/william57m/subscriptions","organizations_url":"https://api.github.com/users/william57m/orgs","repos_url":"https://api.github.com/users/william57m/repos","events_url":"https://api.github.com/users/william57m/events{/privacy}","received_events_url":"https://api.github.com/users/william57m/received_events","type":"User","site_admin":false},"created_at":"2015-03-04T00:10:41Z","updated_at":"2015-03-04T00:10:41Z","body":"Ok I also thought, but the -discardContentIfPossible method doesn't return a boolean value, to say to the cache : \"ok you can discard me or not\".\r\nSo in Objective-C I presume that the NSCache check the counter usage in the case where it's a \"Discardable object\".\r\nSo we have no way to know if an object has to be retained or not, unless to reinvent the protocol or to dig more depth in Cappuccino.\r\n\r\nFor the rest, the method -isContentDiscarded could be useful for the cache to remove object which is not used anymore, but I didn't want to implement a class if we only can exploit a half."}}