{"action":"created","issue":{"url":"https://api.github.com/repos/rstudio/pool/issues/17","repository_url":"https://api.github.com/repos/rstudio/pool","labels_url":"https://api.github.com/repos/rstudio/pool/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/rstudio/pool/issues/17/comments","events_url":"https://api.github.com/repos/rstudio/pool/issues/17/events","html_url":"https://github.com/rstudio/pool/issues/17","id":173550896,"number":17,"title":"Error if shiny not loaded","user":{"login":"1beb","id":421859,"avatar_url":"https://avatars.githubusercontent.com/u/421859?v=3","gravatar_id":"","url":"https://api.github.com/users/1beb","html_url":"https://github.com/1beb","followers_url":"https://api.github.com/users/1beb/followers","following_url":"https://api.github.com/users/1beb/following{/other_user}","gists_url":"https://api.github.com/users/1beb/gists{/gist_id}","starred_url":"https://api.github.com/users/1beb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/1beb/subscriptions","organizations_url":"https://api.github.com/users/1beb/orgs","repos_url":"https://api.github.com/users/1beb/repos","events_url":"https://api.github.com/users/1beb/events{/privacy}","received_events_url":"https://api.github.com/users/1beb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-26T21:52:37Z","updated_at":"2016-09-28T22:59:28Z","closed_at":null,"body":"Great work on this package. I realize that this is intended to be used with shiny, but it works excellently without it with one exception: \r\n\r\nIf you run enough queries using the pool, eventually you'll get one or more of the following error: \r\n\r\n`Error: could not find function \"task\"`\r\n\r\n```\r\n# ... other irrelevant stuff\r\n13: poolReturn(con)\r\n14: pool$release(object)\r\n15: naiveScheduler$protect({\r\n       pool_metadata <- attr(object, \"pool_metadata\", exact = TRUE)\r\n       if (pool_metadata$state == \"free\") {\r\n           stop(\"This object was already returned to the pool.\")\r\n       }\r\n       if (is.null(pool_metadata) || !pool_metadata$valid) {\r\n           stop(\"Invalid object.\")\r\n       }\r\n       if (!self$valid) {\r\n           private$changeObjectStatus(object, NULL)\r\n           return()\r\n       }\r\n       tryCatch({\r\n           onPassivate(object)\r\n       }, error = function(e) {\r\n           private$changeObjectStatus(object, NULL)\r\n           stop(\"Object could not be returned back to the pool. \", \"It was destroyed instead. Error message: \", conditionMessage(e))\r\n       })\r\n       taskHandle <- scheduleTask(self$idleTimeout, function() {\r\n           if (self$counters$free + self$counters$taken > self$minSize) {\r\n               private$changeObjectStatus(object, NULL)\r\n           }\r\n       })\r\n       pool_metadata$destroyHandle <- taskHandle\r\n       private$changeObjectStatus(object, \"free\")\r\n       if (!(is.null(getOption(\"pool.scheduler\", NULL)))) {\r\n           pool_metadata$validateHandle <- scheduleTaskRecurring(self$validationInterval, function() {\r\n               object <- private$checkValid(object)\r\n               onPassivate(object)\r\n           })\r\n       }\r\n   })\r\n16: private$refCount$release()\r\n17: private$callback()\r\n18: self$protect({\r\n       task()\r\n   })\r\n19: force(expr)\r\n```\r\n\r\nI can't seem to find `task()` in this repo, so I presume that it's something in shiny, because if I run the same code over (a series of db pull tests that are now using pool). I get this error if I haven't called `library(shiny)` or treated it as a package dependency.\r\n\r\nIt would be great to see this as a standalone package that doesn't require `shiny`. \r\n"},"comment":{"url":"https://api.github.com/repos/rstudio/pool/issues/comments/250326029","html_url":"https://github.com/rstudio/pool/issues/17#issuecomment-250326029","issue_url":"https://api.github.com/repos/rstudio/pool/issues/17","id":250326029,"user":{"login":"bborgesr","id":6527540,"avatar_url":"https://avatars.githubusercontent.com/u/6527540?v=3","gravatar_id":"","url":"https://api.github.com/users/bborgesr","html_url":"https://github.com/bborgesr","followers_url":"https://api.github.com/users/bborgesr/followers","following_url":"https://api.github.com/users/bborgesr/following{/other_user}","gists_url":"https://api.github.com/users/bborgesr/gists{/gist_id}","starred_url":"https://api.github.com/users/bborgesr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bborgesr/subscriptions","organizations_url":"https://api.github.com/users/bborgesr/orgs","repos_url":"https://api.github.com/users/bborgesr/repos","events_url":"https://api.github.com/users/bborgesr/events{/privacy}","received_events_url":"https://api.github.com/users/bborgesr/received_events","type":"User","site_admin":false},"created_at":"2016-09-28T22:59:28Z","updated_at":"2016-09-28T22:59:28Z","body":"Do you have a reproducible example by any chance?"}}
{"actor":{"display_login":"bborgesr"}}