{"action":"created","issue":{"url":"https://api.github.com/repos/myndzi/pool2/issues/5","labels_url":"https://api.github.com/repos/myndzi/pool2/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/myndzi/pool2/issues/5/comments","events_url":"https://api.github.com/repos/myndzi/pool2/issues/5/events","html_url":"https://github.com/myndzi/pool2/issues/5","id":71712840,"number":5,"title":"Extend 'capabilities' to be more dynamic?","user":{"login":"myndzi","id":1588419,"avatar_url":"https://avatars.githubusercontent.com/u/1588419?v=3","gravatar_id":"","url":"https://api.github.com/users/myndzi","html_url":"https://github.com/myndzi","followers_url":"https://api.github.com/users/myndzi/followers","following_url":"https://api.github.com/users/myndzi/following{/other_user}","gists_url":"https://api.github.com/users/myndzi/gists{/gist_id}","starred_url":"https://api.github.com/users/myndzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myndzi/subscriptions","organizations_url":"https://api.github.com/users/myndzi/orgs","repos_url":"https://api.github.com/users/myndzi/repos","events_url":"https://api.github.com/users/myndzi/events{/privacy}","received_events_url":"https://api.github.com/users/myndzi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-28T21:38:18Z","updated_at":"2015-04-28T21:55:06Z","closed_at":null,"body":"Spawned by the discussion here: https://github.com/tgriesser/knex/issues/802\r\n\r\nUse case: prepared statements are connection-specific; the capabilities function could be used to request connections from the pool which have a given prepared statement available.\r\n\r\nFor this to work, a few things are needed:\r\n\r\n- \"strong\" and \"weak\" capabilities requests: A strong request would return a resource from the pool that can fulfill the capability or wait until one is available; a weak request would return a resource from the pool that can fulfill the capability if available, otherwise return any available resource\r\n- Ability to dynamically manipulate a resource's capabilities, primarily to \"upgrade\" plain connections to connections that have the query prepared\r\n\r\nAlso worth considering:\r\n\r\n- affinity / anti-affinity?\r\n- pool prioritization? (try to serve allocation requests with the \"least-capable\" resource, to leave more specialized resources idle as much as possible?)\r\n- potential use case for hooks? (allow client to prepare statements on new resources when they are requested or when they become idle, for example)\r\n\r\nQuestions:\r\n\r\n- Is the additional complexity worth implementing the feature?\r\n- What would the API look like?\r\n"},"comment":{"url":"https://api.github.com/repos/myndzi/pool2/issues/comments/97236947","html_url":"https://github.com/myndzi/pool2/issues/5#issuecomment-97236947","issue_url":"https://api.github.com/repos/myndzi/pool2/issues/5","id":97236947,"user":{"login":"myndzi","id":1588419,"avatar_url":"https://avatars.githubusercontent.com/u/1588419?v=3","gravatar_id":"","url":"https://api.github.com/users/myndzi","html_url":"https://github.com/myndzi","followers_url":"https://api.github.com/users/myndzi/followers","following_url":"https://api.github.com/users/myndzi/following{/other_user}","gists_url":"https://api.github.com/users/myndzi/gists{/gist_id}","starred_url":"https://api.github.com/users/myndzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/myndzi/subscriptions","organizations_url":"https://api.github.com/users/myndzi/orgs","repos_url":"https://api.github.com/users/myndzi/repos","events_url":"https://api.github.com/users/myndzi/events{/privacy}","received_events_url":"https://api.github.com/users/myndzi/received_events","type":"User","site_admin":false},"created_at":"2015-04-28T21:55:06Z","updated_at":"2015-04-28T21:55:06Z","body":"Last thing (I hope!):\r\n\r\nCurrently 'capabilities' is 1:1 with Pool objects; it's used to select specific Pools among many in a Cluster; the usage discussed here is 1:1 with resource objects and would be used to select specific resources from among a pool or a cluster of pools. This semantic difference could present a problem, but in practice not a very big one: the current syntax can be retained and simply flag every resource within a pool with the specified capabilities when using pools in a cluster, while additional syntax can be added to allow more fine-grained capability manipulation on individual resources."}}