{"action":"created","issue":{"url":"https://api.github.com/repos/xonsh/xonsh/issues/1501","repository_url":"https://api.github.com/repos/xonsh/xonsh","labels_url":"https://api.github.com/repos/xonsh/xonsh/issues/1501/labels{/name}","comments_url":"https://api.github.com/repos/xonsh/xonsh/issues/1501/comments","events_url":"https://api.github.com/repos/xonsh/xonsh/issues/1501/events","html_url":"https://github.com/xonsh/xonsh/pull/1501","id":168013634,"number":1501,"title":"Request for Comments: Events","user":{"login":"astronouth7303","id":401438,"avatar_url":"https://avatars.githubusercontent.com/u/401438?v=3","gravatar_id":"","url":"https://api.github.com/users/astronouth7303","html_url":"https://github.com/astronouth7303","followers_url":"https://api.github.com/users/astronouth7303/followers","following_url":"https://api.github.com/users/astronouth7303/following{/other_user}","gists_url":"https://api.github.com/users/astronouth7303/gists{/gist_id}","starred_url":"https://api.github.com/users/astronouth7303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astronouth7303/subscriptions","organizations_url":"https://api.github.com/users/astronouth7303/orgs","repos_url":"https://api.github.com/users/astronouth7303/repos","events_url":"https://api.github.com/users/astronouth7303/events{/privacy}","received_events_url":"https://api.github.com/users/astronouth7303/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/xonsh/xonsh/labels/feature","name":"feature","color":"009800"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2016-07-28T04:53:07Z","updated_at":"2016-08-22T00:43:57Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xonsh/xonsh/pulls/1501","html_url":"https://github.com/xonsh/xonsh/pull/1501","diff_url":"https://github.com/xonsh/xonsh/pull/1501.diff","patch_url":"https://github.com/xonsh/xonsh/pull/1501.patch"},"body":"Fixes #1489.\r\n\r\nThis is my stab at an event bus, after talking to @scopatz.\r\n\r\nPlease! Comments, questions, etc! I'm open to any ideas, or even scrapping this entire model of events.\r\n\r\nBasic usage, as it stands:\r\n\r\n```python\r\n@__xonsh_events__.on_precommand\r\ndef myhandler(cmd):\r\n    print(\"About to run command:\", cmd)\r\n```\r\n\r\nThis covers stand-alone functions, static methods, and maybe class methods? Instance methods certainly do not work.\r\n\r\nI believe the docstrings cover most of the usage, even if they currently ignore rst and numpy."},"comment":{"url":"https://api.github.com/repos/xonsh/xonsh/issues/comments/241293167","html_url":"https://github.com/xonsh/xonsh/pull/1501#issuecomment-241293167","issue_url":"https://api.github.com/repos/xonsh/xonsh/issues/1501","id":241293167,"user":{"login":"astronouth7303","id":401438,"avatar_url":"https://avatars.githubusercontent.com/u/401438?v=3","gravatar_id":"","url":"https://api.github.com/users/astronouth7303","html_url":"https://github.com/astronouth7303","followers_url":"https://api.github.com/users/astronouth7303/followers","following_url":"https://api.github.com/users/astronouth7303/following{/other_user}","gists_url":"https://api.github.com/users/astronouth7303/gists{/gist_id}","starred_url":"https://api.github.com/users/astronouth7303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astronouth7303/subscriptions","organizations_url":"https://api.github.com/users/astronouth7303/orgs","repos_url":"https://api.github.com/users/astronouth7303/repos","events_url":"https://api.github.com/users/astronouth7303/events{/privacy}","received_events_url":"https://api.github.com/users/astronouth7303/received_events","type":"User","site_admin":false},"created_at":"2016-08-22T00:43:57Z","updated_at":"2016-08-22T00:43:57Z","body":"But no matter when you fired the post-xontrib load event, there's the possibility of a handler being added later.\r\n\r\nConventionally, an event is fired once, all its handlers are processed, and then its over. No more handlers are called until the event is fired again.\r\n\r\nFutures behave more like the load event. The value is returned once, and all the handlers get called. Any handlers that get registered later are called immediately."}}
{"actor":{"display_login":"astronouth7303"}}