{"action":"created","issue":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/47","repository_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO","labels_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/47/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/47/comments","events_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/47/events","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/47","id":41141052,"number":47,"title":"Possible to emit from a Celery task in Flask?","user":{"login":"johnboiles","id":218876,"avatar_url":"https://avatars.githubusercontent.com/u/218876?v=3","gravatar_id":"","url":"https://api.github.com/users/johnboiles","html_url":"https://github.com/johnboiles","followers_url":"https://api.github.com/users/johnboiles/followers","following_url":"https://api.github.com/users/johnboiles/following{/other_user}","gists_url":"https://api.github.com/users/johnboiles/gists{/gist_id}","starred_url":"https://api.github.com/users/johnboiles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnboiles/subscriptions","organizations_url":"https://api.github.com/users/johnboiles/orgs","repos_url":"https://api.github.com/users/johnboiles/repos","events_url":"https://api.github.com/users/johnboiles/events{/privacy}","received_events_url":"https://api.github.com/users/johnboiles/received_events","type":"User","site_admin":false},"labels":[{"id":79522649,"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/labels/enhancement","name":"enhancement","color":"84b6eb","default":true},{"id":79522651,"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/milestones/3","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/milestones/2.0","labels_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/milestones/3/labels","id":1387879,"number":3,"title":"2.0","description":"","creator":{"login":"miguelgrinberg","id":2715854,"avatar_url":"https://avatars.githubusercontent.com/u/2715854?v=3","gravatar_id":"","url":"https://api.github.com/users/miguelgrinberg","html_url":"https://github.com/miguelgrinberg","followers_url":"https://api.github.com/users/miguelgrinberg/followers","following_url":"https://api.github.com/users/miguelgrinberg/following{/other_user}","gists_url":"https://api.github.com/users/miguelgrinberg/gists{/gist_id}","starred_url":"https://api.github.com/users/miguelgrinberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguelgrinberg/subscriptions","organizations_url":"https://api.github.com/users/miguelgrinberg/orgs","repos_url":"https://api.github.com/users/miguelgrinberg/repos","events_url":"https://api.github.com/users/miguelgrinberg/events{/privacy}","received_events_url":"https://api.github.com/users/miguelgrinberg/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":6,"state":"closed","created_at":"2015-11-02T03:07:01Z","updated_at":"2016-01-17T01:40:44Z","due_on":null,"closed_at":"2016-01-17T01:40:44Z"},"comments":49,"created_at":"2014-08-26T06:26:05Z","updated_at":"2016-11-08T03:25:08Z","closed_at":"2016-01-10T02:54:51Z","body":"Trying to emit from a Celery task in Flask. Not sure if this is possible. Here's my simplified code:\n\n```\n@celery.task()\ndef do_stuff():\n    logger.info('emmittting')\n    socketio.emit('my response', {'data': user_cache_key})\n```\n\nI'm using Gunicorn + Celery + SocketIO + Redis (broker + result backend for Celery). Is this even possible? I'm not sure if gevent can communicate to/from a celery worker.\n\nI'm hoping to use websockets to track the progress of long-running Celery tasks.\n"},"comment":{"url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/comments/259035313","html_url":"https://github.com/miguelgrinberg/Flask-SocketIO/issues/47#issuecomment-259035313","issue_url":"https://api.github.com/repos/miguelgrinberg/Flask-SocketIO/issues/47","id":259035313,"user":{"login":"wiwengweng","id":1968042,"avatar_url":"https://avatars.githubusercontent.com/u/1968042?v=3","gravatar_id":"","url":"https://api.github.com/users/wiwengweng","html_url":"https://github.com/wiwengweng","followers_url":"https://api.github.com/users/wiwengweng/followers","following_url":"https://api.github.com/users/wiwengweng/following{/other_user}","gists_url":"https://api.github.com/users/wiwengweng/gists{/gist_id}","starred_url":"https://api.github.com/users/wiwengweng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wiwengweng/subscriptions","organizations_url":"https://api.github.com/users/wiwengweng/orgs","repos_url":"https://api.github.com/users/wiwengweng/repos","events_url":"https://api.github.com/users/wiwengweng/events{/privacy}","received_events_url":"https://api.github.com/users/wiwengweng/received_events","type":"User","site_admin":false},"created_at":"2016-11-08T03:25:08Z","updated_at":"2016-11-08T03:25:08Z","body":"now I change to redis 2.8.4, which worked on Ubuntu.  Still I can receive the message on redis, but the client cannot receive the emit message.\r\nI suppose the following output is the right thing redis should show:\r\n\r\n````\r\nD:\\redis64-2.8.4>redis-cli.exe\r\npsubscribe *\r\npsubscribe\r\n*\r\n1\r\npmessage\r\n*\r\nflask-socketio\r\n(dp0\r\nS'skip_sid'\r\np1\r\nNsS'room'\r\np2\r\nNsS'namespace'\r\np3\r\nS'/'\r\np4\r\nsS'event'\r\np5\r\nS'redis'\r\np6\r\nsS'callback'\r\np7\r\nNsS'data'\r\np8\r\n(dp9\r\ng8\r\nS'you will see this if success'\r\np10\r\nssS'method'\r\np11\r\nS'emit'\r\np12\r\ns.\r\n````"}}
{"actor":{"display_login":"wiwengweng"}}