{"action":"created","issue":{"url":"https://api.github.com/repos/rust-lang-nursery/futures-rs/issues/1087","repository_url":"https://api.github.com/repos/rust-lang-nursery/futures-rs","labels_url":"https://api.github.com/repos/rust-lang-nursery/futures-rs/issues/1087/labels{/name}","comments_url":"https://api.github.com/repos/rust-lang-nursery/futures-rs/issues/1087/comments","events_url":"https://api.github.com/repos/rust-lang-nursery/futures-rs/issues/1087/events","html_url":"https://github.com/rust-lang-nursery/futures-rs/issues/1087","id":341216834,"node_id":"MDU6SXNzdWUzNDEyMTY4MzQ=","number":1087,"title":"Rename \"task\" to \"future\" in futures API","user":{"login":"MajorBreakfast","id":340142,"node_id":"MDQ6VXNlcjM0MDE0Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/340142?v=4","gravatar_id":"","url":"https://api.github.com/users/MajorBreakfast","html_url":"https://github.com/MajorBreakfast","followers_url":"https://api.github.com/users/MajorBreakfast/followers","following_url":"https://api.github.com/users/MajorBreakfast/following{/other_user}","gists_url":"https://api.github.com/users/MajorBreakfast/gists{/gist_id}","starred_url":"https://api.github.com/users/MajorBreakfast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MajorBreakfast/subscriptions","organizations_url":"https://api.github.com/users/MajorBreakfast/orgs","repos_url":"https://api.github.com/users/MajorBreakfast/repos","events_url":"https://api.github.com/users/MajorBreakfast/events{/privacy}","received_events_url":"https://api.github.com/users/MajorBreakfast/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-07-14T07:27:37Z","updated_at":"2018-07-16T18:13:11Z","closed_at":null,"author_association":"COLLABORATOR","body":"This week I explored the code of the futures 0.1's task system. I realized that in futures 0.1 a task was this thing:\r\n\r\n```rust\r\npub struct Task {\r\n    id: usize,\r\n    unpark: TaskUnpark,\r\n    events: UnparkEvents,\r\n}\r\n```\r\n\r\nIn 0.3 the most similar thing to this is the context. In 0.1 there was of course always a future associated with each task. There's so much existing meaning attached to what a task is. It should be seriously considered whether we want to continue using the term \"task\" in 0.3. In 0.3, basically what we call a \"task\" is just a static future with output `()` that is spawned. We could use the term \"task\" for it, but should we?\r\n\r\nSpecifically I'd like to change these occurrences from \"task\" to \"future\":\r\n\r\nhttps://github.com/rust-lang/rust/blob/ccade97544d34f42c37fc27fe8c7edba05d3eddb/src/libcore/task/executor.rs#L32\r\n\r\nhttps://github.com/rust-lang/rust/blob/ccade97544d34f42c37fc27fe8c7edba05d3eddb/src/libcore/task/executor.rs#L79\r\n\r\nEdit: Heh... and the `core::task` module is of course also called \"task\". It was decided to make it an extra module because it is planned that it should contain shared code between `stream` and `future`. And [\"A *task* is a `()`-producing async value\"](https://github.com/rust-lang/rust/blob/ccade97544d34f42c37fc27fe8c7edba05d3eddb/src/libcore/task/executor.rs#L20), i.e. a future. Considering this, the name seems not so suitable."},"comment":{"url":"https://api.github.com/repos/rust-lang-nursery/futures-rs/issues/comments/405332545","html_url":"https://github.com/rust-lang-nursery/futures-rs/issues/1087#issuecomment-405332545","issue_url":"https://api.github.com/repos/rust-lang-nursery/futures-rs/issues/1087","id":405332545,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTMzMjU0NQ==","user":{"login":"MajorBreakfast","id":340142,"node_id":"MDQ6VXNlcjM0MDE0Mg==","avatar_url":"https://avatars2.githubusercontent.com/u/340142?v=4","gravatar_id":"","url":"https://api.github.com/users/MajorBreakfast","html_url":"https://github.com/MajorBreakfast","followers_url":"https://api.github.com/users/MajorBreakfast/followers","following_url":"https://api.github.com/users/MajorBreakfast/following{/other_user}","gists_url":"https://api.github.com/users/MajorBreakfast/gists{/gist_id}","starred_url":"https://api.github.com/users/MajorBreakfast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MajorBreakfast/subscriptions","organizations_url":"https://api.github.com/users/MajorBreakfast/orgs","repos_url":"https://api.github.com/users/MajorBreakfast/repos","events_url":"https://api.github.com/users/MajorBreakfast/events{/privacy}","received_events_url":"https://api.github.com/users/MajorBreakfast/received_events","type":"User","site_admin":false},"created_at":"2018-07-16T18:13:11Z","updated_at":"2018-07-16T18:13:11Z","author_association":"COLLABORATOR","body":"@seanmonstar It seems that you're using a different definition for what a \"task\" is. I was of the impression that a task *has* to be a future. This was based on \"A task is a ()-producing async value\" ([executor.rs](https://doc.rust-lang.org/nightly/src/core/task/executor.rs.html#20)) because \"async value\" is a synonym for \"future\".\r\n\r\n> I can't tell if your edit is saying the proposed changes to futures is not so suitable, or the existing name of task.\r\n\r\nThe latter: I'm saying that \"task\" isn't a good name for the module. If the term \"task\" already refers to a future driven by an executor, then it does't make sense to reuse it as the name for a module that contains shared functionality between the `stream` and `future` modules.\r\n\r\n***\r\n\r\nI always disliked the term \"task\" because it is so imprecise: What exact condition has to be met for a future to become a task? Let's define it as a \"top level\" future run by an a executor. Considering that `LocalPool` is just a thin wrapper around `FuturesUnordered`, is every future in `FuturesUnordered` then also a task? `FutureUnordered` does however neither require a static lifetime nor `()` as output. So, no? Does associating a waker with the future turn it into a task? Or is every future that is polled a task? Why is \"top level\" significant?\r\n\r\nThe term \"task\" is used everywhere in the docs and code comments, but when I want to place my finger on its meaning, I can't do it. So, what exactly is a \"task\" supposed to be and why do we need a special name for it? If it were up to me there would be no tasks and just polled/executed futures.\r\n\r\n(Although, internally I would like to use the term \"task\" for the`{ future, exec, wake_handle }` struct in thread_pool.rs. ATM I can't because the `future` inside it is currently called a `task`. A `task` field within a `Task` struct wouldn't make sense...)\r\n"}}
{"actor":{"display_login":"MajorBreakfast"}}