{"action":"closed","number":38,"pull_request":{"url":"https://api.github.com/repos/unisonweb/unison/pulls/38","id":62651642,"html_url":"https://github.com/unisonweb/unison/pull/38","diff_url":"https://github.com/unisonweb/unison/pull/38.diff","patch_url":"https://github.com/unisonweb/unison/pull/38.patch","issue_url":"https://api.github.com/repos/unisonweb/unison/issues/38","number":38,"state":"closed","locked":false,"title":"Feature/sticky resource pool","user":{"login":"steveshogren","id":449730,"avatar_url":"https://avatars.githubusercontent.com/u/449730?v=3","gravatar_id":"","url":"https://api.github.com/users/steveshogren","html_url":"https://github.com/steveshogren","followers_url":"https://api.github.com/users/steveshogren/followers","following_url":"https://api.github.com/users/steveshogren/following{/other_user}","gists_url":"https://api.github.com/users/steveshogren/gists{/gist_id}","starred_url":"https://api.github.com/users/steveshogren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveshogren/subscriptions","organizations_url":"https://api.github.com/users/steveshogren/orgs","repos_url":"https://api.github.com/users/steveshogren/repos","events_url":"https://api.github.com/users/steveshogren/events{/privacy}","received_events_url":"https://api.github.com/users/steveshogren/received_events","type":"User","site_admin":false},"body":"Should match what is in the feature request. I added the check to allow different threads to each have their own resource in the pool, so they are segregated by parameter and ThreadId.\r\n\r\nThe entry points are ```pool``` and ```poolWithoutGC```. The regular ```pool``` will spawn a second thread that checks for expired resources every second. The ```poolWithoutGC``` will not spawn that thread, so the cache will never be cleaned.\r\n\r\nThe one gotcha right now is what happens when several requests are made to the same resource from the same thread without any of the requests being released. Right now that will cause undefined behavior as each \"release\" will overwrite the previous releases entry in the pool. I am not sure exactly what should happen in that case. \r\n\r\nIt should be fairly well tested, which might account for a few oddities in the function signatures (like passing around a getter for the ThreadId). I am not sure how idiomatic that is in regular Haskell, but it struck me as better than manually testing everything.\r\n\r\nFeel free to comment/reject, I am happy to change whatever!","created_at":"2016-03-12T20:38:45Z","updated_at":"2016-05-20T15:23:31Z","closed_at":"2016-05-20T15:23:31Z","merged_at":"2016-05-20T15:23:31Z","merge_commit_sha":"f65f11067a8e89004811c787a7bac91eacfa57df","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/unisonweb/unison/pulls/38/commits","review_comments_url":"https://api.github.com/repos/unisonweb/unison/pulls/38/comments","review_comment_url":"https://api.github.com/repos/unisonweb/unison/pulls/comments{/number}","comments_url":"https://api.github.com/repos/unisonweb/unison/issues/38/comments","statuses_url":"https://api.github.com/repos/unisonweb/unison/statuses/57745be8b44c4c51e321e7d3d40a99c5467baef1","head":{"label":"steveshogren:feature/sticky-resource-pool","ref":"feature/sticky-resource-pool","sha":"57745be8b44c4c51e321e7d3d40a99c5467baef1","user":{"login":"steveshogren","id":449730,"avatar_url":"https://avatars.githubusercontent.com/u/449730?v=3","gravatar_id":"","url":"https://api.github.com/users/steveshogren","html_url":"https://github.com/steveshogren","followers_url":"https://api.github.com/users/steveshogren/followers","following_url":"https://api.github.com/users/steveshogren/following{/other_user}","gists_url":"https://api.github.com/users/steveshogren/gists{/gist_id}","starred_url":"https://api.github.com/users/steveshogren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveshogren/subscriptions","organizations_url":"https://api.github.com/users/steveshogren/orgs","repos_url":"https://api.github.com/users/steveshogren/repos","events_url":"https://api.github.com/users/steveshogren/events{/privacy}","received_events_url":"https://api.github.com/users/steveshogren/received_events","type":"User","site_admin":false},"repo":{"id":53042856,"name":"unison","full_name":"steveshogren/unison","owner":{"login":"steveshogren","id":449730,"avatar_url":"https://avatars.githubusercontent.com/u/449730?v=3","gravatar_id":"","url":"https://api.github.com/users/steveshogren","html_url":"https://github.com/steveshogren","followers_url":"https://api.github.com/users/steveshogren/followers","following_url":"https://api.github.com/users/steveshogren/following{/other_user}","gists_url":"https://api.github.com/users/steveshogren/gists{/gist_id}","starred_url":"https://api.github.com/users/steveshogren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steveshogren/subscriptions","organizations_url":"https://api.github.com/users/steveshogren/orgs","repos_url":"https://api.github.com/users/steveshogren/repos","events_url":"https://api.github.com/users/steveshogren/events{/privacy}","received_events_url":"https://api.github.com/users/steveshogren/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/steveshogren/unison","description":"Next generation programming platform, currently in development","fork":true,"url":"https://api.github.com/repos/steveshogren/unison","forks_url":"https://api.github.com/repos/steveshogren/unison/forks","keys_url":"https://api.github.com/repos/steveshogren/unison/keys{/key_id}","collaborators_url":"https://api.github.com/repos/steveshogren/unison/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/steveshogren/unison/teams","hooks_url":"https://api.github.com/repos/steveshogren/unison/hooks","issue_events_url":"https://api.github.com/repos/steveshogren/unison/issues/events{/number}","events_url":"https://api.github.com/repos/steveshogren/unison/events","assignees_url":"https://api.github.com/repos/steveshogren/unison/assignees{/user}","branches_url":"https://api.github.com/repos/steveshogren/unison/branches{/branch}","tags_url":"https://api.github.com/repos/steveshogren/unison/tags","blobs_url":"https://api.github.com/repos/steveshogren/unison/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/steveshogren/unison/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/steveshogren/unison/git/refs{/sha}","trees_url":"https://api.github.com/repos/steveshogren/unison/git/trees{/sha}","statuses_url":"https://api.github.com/repos/steveshogren/unison/statuses/{sha}","languages_url":"https://api.github.com/repos/steveshogren/unison/languages","stargazers_url":"https://api.github.com/repos/steveshogren/unison/stargazers","contributors_url":"https://api.github.com/repos/steveshogren/unison/contributors","subscribers_url":"https://api.github.com/repos/steveshogren/unison/subscribers","subscription_url":"https://api.github.com/repos/steveshogren/unison/subscription","commits_url":"https://api.github.com/repos/steveshogren/unison/commits{/sha}","git_commits_url":"https://api.github.com/repos/steveshogren/unison/git/commits{/sha}","comments_url":"https://api.github.com/repos/steveshogren/unison/comments{/number}","issue_comment_url":"https://api.github.com/repos/steveshogren/unison/issues/comments{/number}","contents_url":"https://api.github.com/repos/steveshogren/unison/contents/{+path}","compare_url":"https://api.github.com/repos/steveshogren/unison/compare/{base}...{head}","merges_url":"https://api.github.com/repos/steveshogren/unison/merges","archive_url":"https://api.github.com/repos/steveshogren/unison/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/steveshogren/unison/downloads","issues_url":"https://api.github.com/repos/steveshogren/unison/issues{/number}","pulls_url":"https://api.github.com/repos/steveshogren/unison/pulls{/number}","milestones_url":"https://api.github.com/repos/steveshogren/unison/milestones{/number}","notifications_url":"https://api.github.com/repos/steveshogren/unison/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/steveshogren/unison/labels{/name}","releases_url":"https://api.github.com/repos/steveshogren/unison/releases{/id}","deployments_url":"https://api.github.com/repos/steveshogren/unison/deployments","created_at":"2016-03-03T10:46:15Z","updated_at":"2016-03-03T10:46:16Z","pushed_at":"2016-04-19T11:19:38Z","git_url":"git://github.com/steveshogren/unison.git","ssh_url":"git@github.com:steveshogren/unison.git","clone_url":"https://github.com/steveshogren/unison.git","svn_url":"https://github.com/steveshogren/unison","homepage":"http://unisonweb.org","size":3943,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"unisonweb:master","ref":"master","sha":"157b34024be714f820723674f17cb1bdb80af7e6","user":{"login":"unisonweb","id":7087133,"avatar_url":"https://avatars.githubusercontent.com/u/7087133?v=3","gravatar_id":"","url":"https://api.github.com/users/unisonweb","html_url":"https://github.com/unisonweb","followers_url":"https://api.github.com/users/unisonweb/followers","following_url":"https://api.github.com/users/unisonweb/following{/other_user}","gists_url":"https://api.github.com/users/unisonweb/gists{/gist_id}","starred_url":"https://api.github.com/users/unisonweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unisonweb/subscriptions","organizations_url":"https://api.github.com/users/unisonweb/orgs","repos_url":"https://api.github.com/users/unisonweb/repos","events_url":"https://api.github.com/users/unisonweb/events{/privacy}","received_events_url":"https://api.github.com/users/unisonweb/received_events","type":"Organization","site_admin":false},"repo":{"id":35164952,"name":"unison","full_name":"unisonweb/unison","owner":{"login":"unisonweb","id":7087133,"avatar_url":"https://avatars.githubusercontent.com/u/7087133?v=3","gravatar_id":"","url":"https://api.github.com/users/unisonweb","html_url":"https://github.com/unisonweb","followers_url":"https://api.github.com/users/unisonweb/followers","following_url":"https://api.github.com/users/unisonweb/following{/other_user}","gists_url":"https://api.github.com/users/unisonweb/gists{/gist_id}","starred_url":"https://api.github.com/users/unisonweb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unisonweb/subscriptions","organizations_url":"https://api.github.com/users/unisonweb/orgs","repos_url":"https://api.github.com/users/unisonweb/repos","events_url":"https://api.github.com/users/unisonweb/events{/privacy}","received_events_url":"https://api.github.com/users/unisonweb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/unisonweb/unison","description":"Next generation programming platform, currently in development","fork":false,"url":"https://api.github.com/repos/unisonweb/unison","forks_url":"https://api.github.com/repos/unisonweb/unison/forks","keys_url":"https://api.github.com/repos/unisonweb/unison/keys{/key_id}","collaborators_url":"https://api.github.com/repos/unisonweb/unison/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/unisonweb/unison/teams","hooks_url":"https://api.github.com/repos/unisonweb/unison/hooks","issue_events_url":"https://api.github.com/repos/unisonweb/unison/issues/events{/number}","events_url":"https://api.github.com/repos/unisonweb/unison/events","assignees_url":"https://api.github.com/repos/unisonweb/unison/assignees{/user}","branches_url":"https://api.github.com/repos/unisonweb/unison/branches{/branch}","tags_url":"https://api.github.com/repos/unisonweb/unison/tags","blobs_url":"https://api.github.com/repos/unisonweb/unison/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/unisonweb/unison/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/unisonweb/unison/git/refs{/sha}","trees_url":"https://api.github.com/repos/unisonweb/unison/git/trees{/sha}","statuses_url":"https://api.github.com/repos/unisonweb/unison/statuses/{sha}","languages_url":"https://api.github.com/repos/unisonweb/unison/languages","stargazers_url":"https://api.github.com/repos/unisonweb/unison/stargazers","contributors_url":"https://api.github.com/repos/unisonweb/unison/contributors","subscribers_url":"https://api.github.com/repos/unisonweb/unison/subscribers","subscription_url":"https://api.github.com/repos/unisonweb/unison/subscription","commits_url":"https://api.github.com/repos/unisonweb/unison/commits{/sha}","git_commits_url":"https://api.github.com/repos/unisonweb/unison/git/commits{/sha}","comments_url":"https://api.github.com/repos/unisonweb/unison/comments{/number}","issue_comment_url":"https://api.github.com/repos/unisonweb/unison/issues/comments{/number}","contents_url":"https://api.github.com/repos/unisonweb/unison/contents/{+path}","compare_url":"https://api.github.com/repos/unisonweb/unison/compare/{base}...{head}","merges_url":"https://api.github.com/repos/unisonweb/unison/merges","archive_url":"https://api.github.com/repos/unisonweb/unison/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/unisonweb/unison/downloads","issues_url":"https://api.github.com/repos/unisonweb/unison/issues{/number}","pulls_url":"https://api.github.com/repos/unisonweb/unison/pulls{/number}","milestones_url":"https://api.github.com/repos/unisonweb/unison/milestones{/number}","notifications_url":"https://api.github.com/repos/unisonweb/unison/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/unisonweb/unison/labels{/name}","releases_url":"https://api.github.com/repos/unisonweb/unison/releases{/id}","deployments_url":"https://api.github.com/repos/unisonweb/unison/deployments","created_at":"2015-05-06T14:53:49Z","updated_at":"2016-05-20T11:53:32Z","pushed_at":"2016-05-20T15:23:31Z","git_url":"git://github.com/unisonweb/unison.git","ssh_url":"git@github.com:unisonweb/unison.git","clone_url":"https://github.com/unisonweb/unison.git","svn_url":"https://github.com/unisonweb/unison","homepage":"http://unisonweb.org","size":3980,"stargazers_count":810,"watchers_count":810,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":10,"forks":26,"open_issues":10,"watchers":810,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/unisonweb/unison/pulls/38"},"html":{"href":"https://github.com/unisonweb/unison/pull/38"},"issue":{"href":"https://api.github.com/repos/unisonweb/unison/issues/38"},"comments":{"href":"https://api.github.com/repos/unisonweb/unison/issues/38/comments"},"review_comments":{"href":"https://api.github.com/repos/unisonweb/unison/pulls/38/comments"},"review_comment":{"href":"https://api.github.com/repos/unisonweb/unison/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/unisonweb/unison/pulls/38/commits"},"statuses":{"href":"https://api.github.com/repos/unisonweb/unison/statuses/57745be8b44c4c51e321e7d3d40a99c5467baef1"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"pchiusano","id":11074,"avatar_url":"https://avatars.githubusercontent.com/u/11074?v=3","gravatar_id":"","url":"https://api.github.com/users/pchiusano","html_url":"https://github.com/pchiusano","followers_url":"https://api.github.com/users/pchiusano/followers","following_url":"https://api.github.com/users/pchiusano/following{/other_user}","gists_url":"https://api.github.com/users/pchiusano/gists{/gist_id}","starred_url":"https://api.github.com/users/pchiusano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pchiusano/subscriptions","organizations_url":"https://api.github.com/users/pchiusano/orgs","repos_url":"https://api.github.com/users/pchiusano/repos","events_url":"https://api.github.com/users/pchiusano/events{/privacy}","received_events_url":"https://api.github.com/users/pchiusano/received_events","type":"User","site_admin":false},"comments":11,"review_comments":19,"commits":18,"additions":349,"deletions":46,"changed_files":7}}
{"actor":{"display_login":"pchiusano"}}