{"action":"opened","issue":{"url":"https://api.github.com/repos/zonyitoo/coio-rs/issues/45","repository_url":"https://api.github.com/repos/zonyitoo/coio-rs","labels_url":"https://api.github.com/repos/zonyitoo/coio-rs/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/zonyitoo/coio-rs/issues/45/comments","events_url":"https://api.github.com/repos/zonyitoo/coio-rs/issues/45/events","html_url":"https://github.com/zonyitoo/coio-rs/issues/45","id":135209816,"number":45,"title":"Redesign of `block_with`","user":{"login":"zonyitoo","id":1067951,"avatar_url":"https://avatars.githubusercontent.com/u/1067951?v=3","gravatar_id":"","url":"https://api.github.com/users/zonyitoo","html_url":"https://github.com/zonyitoo","followers_url":"https://api.github.com/users/zonyitoo/followers","following_url":"https://api.github.com/users/zonyitoo/following{/other_user}","gists_url":"https://api.github.com/users/zonyitoo/gists{/gist_id}","starred_url":"https://api.github.com/users/zonyitoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zonyitoo/subscriptions","organizations_url":"https://api.github.com/users/zonyitoo/orgs","repos_url":"https://api.github.com/users/zonyitoo/repos","events_url":"https://api.github.com/users/zonyitoo/events{/privacy}","received_events_url":"https://api.github.com/users/zonyitoo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zonyitoo/coio-rs/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-21T14:12:39Z","updated_at":"2016-02-21T14:12:39Z","closed_at":null,"body":"Currently the `Processor` provides a `block_with` function to run a callback on the `Processor`'s stack after the current coroutine is yielded back. But it is dangerous if you dropped the handle inside this callback, because some of the data that you captured are allocated on the coroutine's stack (including the closure itself). So if you continue to run the function, you may end up to memory corruption.\r\n\r\nSo the `block_with` mechanism have to be redesign, which have to meet the following goals:\r\n\r\n1. The closure should not be marked with `'static` lifetime.\r\n2. Drop the `Handle` after the function return.\r\n3. Allow to store the `Handle` somewhere in the function."}}