{"action":"created","issue":{"url":"https://api.github.com/repos/miguelgrinberg/python-engineio/issues/27","repository_url":"https://api.github.com/repos/miguelgrinberg/python-engineio","labels_url":"https://api.github.com/repos/miguelgrinberg/python-engineio/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/miguelgrinberg/python-engineio/issues/27/comments","events_url":"https://api.github.com/repos/miguelgrinberg/python-engineio/issues/27/events","html_url":"https://github.com/miguelgrinberg/python-engineio/pull/27","id":172325836,"number":27,"title":"Optionally pass environ to message event handler","user":{"login":"efficiosoft","id":15107268,"avatar_url":"https://avatars.githubusercontent.com/u/15107268?v=3","gravatar_id":"","url":"https://api.github.com/users/efficiosoft","html_url":"https://github.com/efficiosoft","followers_url":"https://api.github.com/users/efficiosoft/followers","following_url":"https://api.github.com/users/efficiosoft/following{/other_user}","gists_url":"https://api.github.com/users/efficiosoft/gists{/gist_id}","starred_url":"https://api.github.com/users/efficiosoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efficiosoft/subscriptions","organizations_url":"https://api.github.com/users/efficiosoft/orgs","repos_url":"https://api.github.com/users/efficiosoft/repos","events_url":"https://api.github.com/users/efficiosoft/events{/privacy}","received_events_url":"https://api.github.com/users/efficiosoft/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-08-21T15:21:41Z","updated_at":"2016-08-22T21:39:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/miguelgrinberg/python-engineio/pulls/27","html_url":"https://github.com/miguelgrinberg/python-engineio/pull/27","diff_url":"https://github.com/miguelgrinberg/python-engineio/pull/27.diff","patch_url":"https://github.com/miguelgrinberg/python-engineio/pull/27.patch"},"body":"I was looking for a method to always have the current ``environ`` at hand in an event handler. For that to work, I added the ``pass_environ`` keyword argument to ``engineio.Server`` initialization with a default of ``False``. If it is set to ``True``, the current ``environ`` is passed to the event handler for ``'message'`` as second argument, after ``sid``.\r\n\r\nBy *current* ``environ`` I mean the one belonging to a particular event triggering.\r\n\r\nThis behaviour ensures backwards compatibility and is not noticeable for those who don't enable it explicitly.\r\n\r\nI also wrote an addition to the ``socketio`` library to let it pass through the ``environ`` to it's registered event handlers. I'll submit another pull request for that part."},"comment":{"url":"https://api.github.com/repos/miguelgrinberg/python-engineio/issues/comments/241559468","html_url":"https://github.com/miguelgrinberg/python-engineio/pull/27#issuecomment-241559468","issue_url":"https://api.github.com/repos/miguelgrinberg/python-engineio/issues/27","id":241559468,"user":{"login":"efficiosoft","id":15107268,"avatar_url":"https://avatars.githubusercontent.com/u/15107268?v=3","gravatar_id":"","url":"https://api.github.com/users/efficiosoft","html_url":"https://github.com/efficiosoft","followers_url":"https://api.github.com/users/efficiosoft/followers","following_url":"https://api.github.com/users/efficiosoft/following{/other_user}","gists_url":"https://api.github.com/users/efficiosoft/gists{/gist_id}","starred_url":"https://api.github.com/users/efficiosoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efficiosoft/subscriptions","organizations_url":"https://api.github.com/users/efficiosoft/orgs","repos_url":"https://api.github.com/users/efficiosoft/repos","events_url":"https://api.github.com/users/efficiosoft/events{/privacy}","received_events_url":"https://api.github.com/users/efficiosoft/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T21:39:07Z","updated_at":"2016-08-22T21:39:07Z","body":"How do you actually share a users state between workers when using polling? With an environment to take a cookie from it would be easy.\n"}}
{"actor":{"display_login":"efficiosoft"}}