{"action":"created","issue":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2801","repository_url":"https://api.github.com/repos/ARMmbed/mbed-os","labels_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2801/labels{/name}","comments_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2801/comments","events_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2801/events","html_url":"https://github.com/ARMmbed/mbed-os/pull/2801","id":178953203,"number":2801,"title":"Event loop","user":{"login":"bogdanm","id":211717,"avatar_url":"https://avatars.githubusercontent.com/u/211717?v=3","gravatar_id":"","url":"https://api.github.com/users/bogdanm","html_url":"https://github.com/bogdanm","followers_url":"https://api.github.com/users/bogdanm/followers","following_url":"https://api.github.com/users/bogdanm/following{/other_user}","gists_url":"https://api.github.com/users/bogdanm/gists{/gist_id}","starred_url":"https://api.github.com/users/bogdanm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bogdanm/subscriptions","organizations_url":"https://api.github.com/users/bogdanm/orgs","repos_url":"https://api.github.com/users/bogdanm/repos","events_url":"https://api.github.com/users/bogdanm/events{/privacy}","received_events_url":"https://api.github.com/users/bogdanm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ARMmbed/mbed-os/labels/needs:%20review","name":"needs: review","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-09-23T19:15:32Z","updated_at":"2016-09-29T21:55:04Z","closed_at":"2016-09-27T14:52:59Z","pull_request":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/pulls/2801","html_url":"https://github.com/ARMmbed/mbed-os/pull/2801","diff_url":"https://github.com/ARMmbed/mbed-os/pull/2801.diff","patch_url":"https://github.com/ARMmbed/mbed-os/pull/2801.patch"},"body":"## Description\r\nAdds the Event type and an event loop (EventLoop) for event-based programming.\r\n\r\n## Status\r\nMain code ready. More tests and more documentation to follow.\r\n\r\n## Migrations\r\nAPI changes are backward compatible."},"comment":{"url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/comments/250602418","html_url":"https://github.com/ARMmbed/mbed-os/pull/2801#issuecomment-250602418","issue_url":"https://api.github.com/repos/ARMmbed/mbed-os/issues/2801","id":250602418,"user":{"login":"c1728p9","id":2916772,"avatar_url":"https://avatars.githubusercontent.com/u/2916772?v=3","gravatar_id":"","url":"https://api.github.com/users/c1728p9","html_url":"https://github.com/c1728p9","followers_url":"https://api.github.com/users/c1728p9/followers","following_url":"https://api.github.com/users/c1728p9/following{/other_user}","gists_url":"https://api.github.com/users/c1728p9/gists{/gist_id}","starred_url":"https://api.github.com/users/c1728p9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c1728p9/subscriptions","organizations_url":"https://api.github.com/users/c1728p9/orgs","repos_url":"https://api.github.com/users/c1728p9/repos","events_url":"https://api.github.com/users/c1728p9/events{/privacy}","received_events_url":"https://api.github.com/users/c1728p9/received_events","type":"User","site_admin":false},"created_at":"2016-09-29T21:55:04Z","updated_at":"2016-09-29T21:55:04Z","body":"I think there might still be some useful discussion left in this PR. \r\n\r\n@pan-, you mentioned having an example showing the use of Ticker and Timeout from the event queue. This is a great idea. It would give me much more confidence in the implementation if one or more of the existing drivers could be updated to use this as a proof of concept.\r\n\r\nThe way I would envision Ticker and Timeout being used in a driver is as resources that are part of a class. This would both make their use apparent and allocate space for them. Any information that needs to be moved out of an ISR could be done by pushing data onto a circular buffer.\r\n\r\n```\r\nclass SomeConnectionHandler {\r\n    ...\r\n    SomeConnectionHandler(EventLoop* event_loop) {\r\n        loop = event_loop;\r\n    }\r\n    ...\r\n    EventLoop * loop;\r\n    Timeout tx_timeout;\r\n    Timeout rx_timeout;\r\n    Ticker state_check;\r\n    CircularBuffer<uint8_t, 1024> data_buffer;\r\n};"}}
{"actor":{"display_login":"c1728p9"}}