{"action":"created","issue":{"url":"https://api.github.com/repos/3stack-software/celery-shoot/issues/2","labels_url":"https://api.github.com/repos/3stack-software/celery-shoot/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/3stack-software/celery-shoot/issues/2/comments","events_url":"https://api.github.com/repos/3stack-software/celery-shoot/issues/2/events","html_url":"https://github.com/3stack-software/celery-shoot/issues/2","id":96174719,"number":2,"title":"Usage example in Meteor / mysterious assertion error","user":{"login":"optilude","id":160906,"avatar_url":"https://avatars.githubusercontent.com/u/160906?v=3","gravatar_id":"","url":"https://api.github.com/users/optilude","html_url":"https://github.com/optilude","followers_url":"https://api.github.com/users/optilude/followers","following_url":"https://api.github.com/users/optilude/following{/other_user}","gists_url":"https://api.github.com/users/optilude/gists{/gist_id}","starred_url":"https://api.github.com/users/optilude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/optilude/subscriptions","organizations_url":"https://api.github.com/users/optilude/orgs","repos_url":"https://api.github.com/users/optilude/repos","events_url":"https://api.github.com/users/optilude/events{/privacy}","received_events_url":"https://api.github.com/users/optilude/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-20T22:14:38Z","updated_at":"2015-07-20T22:51:34Z","closed_at":null,"body":"Hi,\r\n\r\nI'm trying to use this in Meteor via `3stack:meteor-connect`.\r\n\r\nCelery is configured with:\r\n\r\n    app = Celery('jiraflow',\r\n             broker='amqp://',\r\n             backend='amqp://',\r\n             include=['proj.tasks'])\r\n\r\nMeteor is started with `env CELERY_BROKER_URL=\"amqp://\" meteor`\r\n\r\nMethod is defined with:\r\n\r\n    runCeleryTask: function(left, right) {\r\n        this.unblock();\r\n\r\n        var task = Celery.createTask('proj.tasks.add');\r\n\r\n        try {\r\n            return Meteor.wrapAsync(task.invoke, task)([left, right]);\r\n        } catch(e) {\r\n            console.error(e);\r\n        }\r\n    }\r\n\r\nThis is called from the client with: `Meteor.apply(\"runCeleryTask\", [3, 3], {wait: true}, function(err, result) { console.log(\"Done\"); console.log(err); console.log(result); })`.\r\n\r\nThis fails with an error in the logs:\r\n\r\n    W20150720-23:16:07.845(1)? (STDERR) AssertionError: false == true\r\n    W20150720-23:16:07.845(1)? (STDERR)     at Task.CeleryTask_sendMessage [as sendMessage] (/Users/maraspeli/.meteor/packages/3stack_celery-shoot/.4.0.1.1gklmv3++os+web.browser+web.cordova/npm/node_modules/celery-shoot/src/lib/Task.js:182:5)\r\n    W20150720-23:16:07.845(1)? (STDERR)     at Task.CeleryTask_invoke [as invoke] (/Users/maraspeli/.meteor/packages/3stack_celery-shoot/.4.0.1.1gklmv3++os+web.browser+web.cordova/npm/node_modules/celery-shoot/src/lib/Task.js:104:10)\r\n    W20150720-23:16:07.845(1)? (STDERR)     at packages/meteor/helpers.js:118:1\r\n    W20150720-23:16:07.845(1)? (STDERR)     at [object Object].Meteor.methods.runCeleryTask (server/query.import.js:41:55)\r\n    W20150720-23:16:07.845(1)? (STDERR)     at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1617:1)\r\n    W20150720-23:16:07.846(1)? (STDERR)     at packages/ddp/livedata_server.js:648:1\r\n    W20150720-23:16:07.846(1)? (STDERR)     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)\r\n    W20150720-23:16:07.846(1)? (STDERR)     at packages/ddp/livedata_server.js:647:1\r\n    W20150720-23:16:07.846(1)? (STDERR)     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)\r\n    W20150720-23:16:07.846(1)? (STDERR)     at [object Object]._.extend.protocol_handlers.method (packages/ddp/livedata_server.js:646:1)\r\n\r\nI can't really understand what's going on :(\r\n\r\nThere doesn't seem to be docs explaining how to use it with Meteor, and `3stack:celery` seems to be a different thing now? What am I missing?\r\n\r\nMartin"},"comment":{"url":"https://api.github.com/repos/3stack-software/celery-shoot/issues/comments/123080262","html_url":"https://github.com/3stack-software/celery-shoot/issues/2#issuecomment-123080262","issue_url":"https://api.github.com/repos/3stack-software/celery-shoot/issues/2","id":123080262,"user":{"login":"nathan-muir","id":3112329,"avatar_url":"https://avatars.githubusercontent.com/u/3112329?v=3","gravatar_id":"","url":"https://api.github.com/users/nathan-muir","html_url":"https://github.com/nathan-muir","followers_url":"https://api.github.com/users/nathan-muir/followers","following_url":"https://api.github.com/users/nathan-muir/following{/other_user}","gists_url":"https://api.github.com/users/nathan-muir/gists{/gist_id}","starred_url":"https://api.github.com/users/nathan-muir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathan-muir/subscriptions","organizations_url":"https://api.github.com/users/nathan-muir/orgs","repos_url":"https://api.github.com/users/nathan-muir/repos","events_url":"https://api.github.com/users/nathan-muir/events{/privacy}","received_events_url":"https://api.github.com/users/nathan-muir/received_events","type":"User","site_admin":false},"created_at":"2015-07-20T22:51:34Z","updated_at":"2015-07-20T22:51:34Z","body":"Hi @optilude,\r\n\r\n1. The assertion that's failing, is that it doesn't have an active connection.\r\n2. The new AMQP library that I'm using is much more sensitive with the `CELERY_BROKER_URL`... try specifying every component, `amqp://guest:guest@localhost:5672//`\r\n3. You don't need to do `Meteor.wrapAsync` - running `celery-connect` / `celery-shoot` as a meteor package automatically mixes in `task.invokeSync`.\r\n\r\neg:\r\n```js\r\nrunCeleryTask: function(left, right) {\r\n    this.unblock();\r\n\r\n    var task = Celery.createTask('proj.tasks.add');\r\n\r\n    try {\r\n        return task.invokeSync([left, right]);\r\n    } catch(e) {\r\n        console.error(e);\r\n    }\r\n}\r\n```\r\n\r\n4. Yeah, I haven't had the chance to write up some decent docs! I'll try get some meteor examples added."}}