{"action":"created","issue":{"url":"https://api.github.com/repos/ocsigen/lwt/issues/239","repository_url":"https://api.github.com/repos/ocsigen/lwt","labels_url":"https://api.github.com/repos/ocsigen/lwt/issues/239/labels{/name}","comments_url":"https://api.github.com/repos/ocsigen/lwt/issues/239/comments","events_url":"https://api.github.com/repos/ocsigen/lwt/issues/239/events","html_url":"https://github.com/ocsigen/lwt/pull/239","id":153149700,"number":239,"title":"change close semantics for fixed-length sources","user":{"login":"seliopou","id":25269,"avatar_url":"https://avatars.githubusercontent.com/u/25269?v=3","gravatar_id":"","url":"https://api.github.com/users/seliopou","html_url":"https://github.com/seliopou","followers_url":"https://api.github.com/users/seliopou/followers","following_url":"https://api.github.com/users/seliopou/following{/other_user}","gists_url":"https://api.github.com/users/seliopou/gists{/gist_id}","starred_url":"https://api.github.com/users/seliopou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seliopou/subscriptions","organizations_url":"https://api.github.com/users/seliopou/orgs","repos_url":"https://api.github.com/users/seliopou/repos","events_url":"https://api.github.com/users/seliopou/events{/privacy}","received_events_url":"https://api.github.com/users/seliopou/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2016-05-05T01:12:52Z","updated_at":"2016-06-26T20:06:36Z","closed_at":"2016-06-21T06:09:38Z","pull_request":{"url":"https://api.github.com/repos/ocsigen/lwt/pulls/239","html_url":"https://github.com/ocsigen/lwt/pull/239","diff_url":"https://github.com/ocsigen/lwt/pull/239.diff","patch_url":"https://github.com/ocsigen/lwt/pull/239.patch"},"body":"This pull request includes a change to the close semantics of fixed-length sources that was previously included in #223, but requires further discussion. An extensive discussion in IRC took place between myself and @aantron, which can be found [here](http://irclog.whitequark.org/ocaml/2016-05-04#16365196;).\r\n\r\nIn summary, changing `of_list` and `of_array` to be closed by default is likely an acceptable choice, but the library should accommodate similar functionality for other sort of structures. Right now, this could be accomplished with a function of the following form:\r\n\r\n```ocaml\r\nlet init (k:('a -> unit) -> unit) : 'a Lwt_stream.t =\r\n  let stream, push = Lwt_stream.create () in\r\n  k (fun x -> push (Some x));\r\n  k None;\r\n  stream\r\n```\r\n\r\nHowever, that may not be at all obvious to users.\r\n\r\nThe motivation for this change is to allow libraries that consume a user-constructed stream to be able to determine the blocking behavior of a stream and use appropriate serialization strategies. As of now, there is no way in general to determine whether a stream will block in order to generate its elements, or if all its elements have been generated and can be read immediately. In the case of `of_list` and `of_array`, this is information is known when the constructors are called, but is then discarded. This pull request would not discard that information.\r\n\r\nDepends on #223."},"comment":{"url":"https://api.github.com/repos/ocsigen/lwt/issues/comments/228619781","html_url":"https://github.com/ocsigen/lwt/pull/239#issuecomment-228619781","issue_url":"https://api.github.com/repos/ocsigen/lwt/issues/239","id":228619781,"user":{"login":"seliopou","id":25269,"avatar_url":"https://avatars.githubusercontent.com/u/25269?v=3","gravatar_id":"","url":"https://api.github.com/users/seliopou","html_url":"https://github.com/seliopou","followers_url":"https://api.github.com/users/seliopou/followers","following_url":"https://api.github.com/users/seliopou/following{/other_user}","gists_url":"https://api.github.com/users/seliopou/gists{/gist_id}","starred_url":"https://api.github.com/users/seliopou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seliopou/subscriptions","organizations_url":"https://api.github.com/users/seliopou/orgs","repos_url":"https://api.github.com/users/seliopou/repos","events_url":"https://api.github.com/users/seliopou/events{/privacy}","received_events_url":"https://api.github.com/users/seliopou/received_events","type":"User","site_admin":false},"created_at":"2016-06-26T20:06:36Z","updated_at":"2016-06-26T20:06:36Z","body":"Childish."}}
{"actor":{"display_login":"seliopou"}}