{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/corefx/issues/27560","repository_url":"https://api.github.com/repos/dotnet/corefx","labels_url":"https://api.github.com/repos/dotnet/corefx/issues/27560/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/corefx/issues/27560/comments","events_url":"https://api.github.com/repos/dotnet/corefx/issues/27560/events","html_url":"https://github.com/dotnet/corefx/issues/27560","id":301141479,"number":27560,"title":"Add PipeWriter.WaitToWriteAsync api to pipelines","user":{"login":"pakrym","id":1697911,"avatar_url":"https://avatars0.githubusercontent.com/u/1697911?v=4","gravatar_id":"","url":"https://api.github.com/users/pakrym","html_url":"https://github.com/pakrym","followers_url":"https://api.github.com/users/pakrym/followers","following_url":"https://api.github.com/users/pakrym/following{/other_user}","gists_url":"https://api.github.com/users/pakrym/gists{/gist_id}","starred_url":"https://api.github.com/users/pakrym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pakrym/subscriptions","organizations_url":"https://api.github.com/users/pakrym/orgs","repos_url":"https://api.github.com/users/pakrym/repos","events_url":"https://api.github.com/users/pakrym/events{/privacy}","received_events_url":"https://api.github.com/users/pakrym/received_events","type":"User","site_admin":false},"labels":[{"id":703517252,"url":"https://api.github.com/repos/dotnet/corefx/labels/api-suggestion","name":"api-suggestion","color":"1d76db","default":false},{"id":821858300,"url":"https://api.github.com/repos/dotnet/corefx/labels/area-System.IO.Pipelines","name":"area-System.IO.Pipelines","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":{"login":"pakrym","id":1697911,"avatar_url":"https://avatars0.githubusercontent.com/u/1697911?v=4","gravatar_id":"","url":"https://api.github.com/users/pakrym","html_url":"https://github.com/pakrym","followers_url":"https://api.github.com/users/pakrym/followers","following_url":"https://api.github.com/users/pakrym/following{/other_user}","gists_url":"https://api.github.com/users/pakrym/gists{/gist_id}","starred_url":"https://api.github.com/users/pakrym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pakrym/subscriptions","organizations_url":"https://api.github.com/users/pakrym/orgs","repos_url":"https://api.github.com/users/pakrym/repos","events_url":"https://api.github.com/users/pakrym/events{/privacy}","received_events_url":"https://api.github.com/users/pakrym/received_events","type":"User","site_admin":false},"assignees":[{"login":"pakrym","id":1697911,"avatar_url":"https://avatars0.githubusercontent.com/u/1697911?v=4","gravatar_id":"","url":"https://api.github.com/users/pakrym","html_url":"https://github.com/pakrym","followers_url":"https://api.github.com/users/pakrym/followers","following_url":"https://api.github.com/users/pakrym/following{/other_user}","gists_url":"https://api.github.com/users/pakrym/gists{/gist_id}","starred_url":"https://api.github.com/users/pakrym/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pakrym/subscriptions","organizations_url":"https://api.github.com/users/pakrym/orgs","repos_url":"https://api.github.com/users/pakrym/repos","events_url":"https://api.github.com/users/pakrym/events{/privacy}","received_events_url":"https://api.github.com/users/pakrym/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-02-28T18:56:16Z","updated_at":"2018-02-28T21:10:32Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"With the current pattern of using pipe there is no way to delay starting producer until consumer starts reading without using the side channel.\r\n\r\nIf we take HTTP MessageBody as an example we have to start consuming raw bytes and populating message body pipe as soon as the user accesses HttpRequest.MessageBody property instead of waiting for the actual read. This some resource and could be avoided.\r\n\r\nI propose adding a method `PipeWriter.WaitToWriteAsync()` that would return `ValueTask` that gets completed when `ReadAsync` is called by the reader and there is no backpressure being applied currently.\r\n\r\n\r\n```C#\r\npublic abstract class PipeWriter\r\n{\r\n    public abstract ValueTask WaitToWriteAsync();\r\n}\r\n\r\n```\r\n\r\n\r\nOpen questions: \r\n- Do we need cancellation token argument.\r\n- Do we need `CancelPendingWaitToWrite`?\r\n- How wuld `CancelPendingFlush` affect this call?\r\n- Do we need result struct with `IsCompleted`?\r\n\r\n/cc @davidfowl @KrzysztofCwalina "},"comment":{"url":"https://api.github.com/repos/dotnet/corefx/issues/comments/369383878","html_url":"https://github.com/dotnet/corefx/issues/27560#issuecomment-369383878","issue_url":"https://api.github.com/repos/dotnet/corefx/issues/27560","id":369383878,"user":{"login":"KrzysztofCwalina","id":9724236,"avatar_url":"https://avatars0.githubusercontent.com/u/9724236?v=4","gravatar_id":"","url":"https://api.github.com/users/KrzysztofCwalina","html_url":"https://github.com/KrzysztofCwalina","followers_url":"https://api.github.com/users/KrzysztofCwalina/followers","following_url":"https://api.github.com/users/KrzysztofCwalina/following{/other_user}","gists_url":"https://api.github.com/users/KrzysztofCwalina/gists{/gist_id}","starred_url":"https://api.github.com/users/KrzysztofCwalina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KrzysztofCwalina/subscriptions","organizations_url":"https://api.github.com/users/KrzysztofCwalina/orgs","repos_url":"https://api.github.com/users/KrzysztofCwalina/repos","events_url":"https://api.github.com/users/KrzysztofCwalina/events{/privacy}","received_events_url":"https://api.github.com/users/KrzysztofCwalina/received_events","type":"User","site_admin":false},"created_at":"2018-02-28T21:10:32Z","updated_at":"2018-02-28T21:10:32Z","author_association":"MEMBER","body":"> You wouldn't be able to use FlushAsync and WaitToWriteAsync concurrently, would you?\r\n\r\nThat's what I thought, just wanted to make sure."}}
{"actor":{"display_login":"KrzysztofCwalina"}}