{"action":"created","issue":{"url":"https://api.github.com/repos/ocsigen/lwt/issues/642","repository_url":"https://api.github.com/repos/ocsigen/lwt","labels_url":"https://api.github.com/repos/ocsigen/lwt/issues/642/labels{/name}","comments_url":"https://api.github.com/repos/ocsigen/lwt/issues/642/comments","events_url":"https://api.github.com/repos/ocsigen/lwt/issues/642/events","html_url":"https://github.com/ocsigen/lwt/issues/642","id":386579814,"node_id":"MDU6SXNzdWUzODY1Nzk4MTQ=","number":642,"title":"Mvar read ","user":{"login":"kydos","id":924895,"node_id":"MDQ6VXNlcjkyNDg5NQ==","avatar_url":"https://avatars2.githubusercontent.com/u/924895?v=4","gravatar_id":"","url":"https://api.github.com/users/kydos","html_url":"https://github.com/kydos","followers_url":"https://api.github.com/users/kydos/followers","following_url":"https://api.github.com/users/kydos/following{/other_user}","gists_url":"https://api.github.com/users/kydos/gists{/gist_id}","starred_url":"https://api.github.com/users/kydos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kydos/subscriptions","organizations_url":"https://api.github.com/users/kydos/orgs","repos_url":"https://api.github.com/users/kydos/repos","events_url":"https://api.github.com/users/kydos/events{/privacy}","received_events_url":"https://api.github.com/users/kydos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2018-12-02T17:19:48Z","updated_at":"2018-12-05T09:49:12Z","closed_at":null,"author_association":"NONE","body":"In my experience at times it is useful to access the content of an Mvar w/o taking it and letting other concurrent computation consume the value in the mvar. Today one is forced to do a take/put which works out, but perhaps the read operation could be implemented in a far more efficient manner. "},"comment":{"url":"https://api.github.com/repos/ocsigen/lwt/issues/comments/444424511","html_url":"https://github.com/ocsigen/lwt/issues/642#issuecomment-444424511","issue_url":"https://api.github.com/repos/ocsigen/lwt/issues/642","id":444424511,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDQyNDUxMQ==","user":{"login":"aantron","id":12073668,"node_id":"MDQ6VXNlcjEyMDczNjY4","avatar_url":"https://avatars2.githubusercontent.com/u/12073668?v=4","gravatar_id":"","url":"https://api.github.com/users/aantron","html_url":"https://github.com/aantron","followers_url":"https://api.github.com/users/aantron/followers","following_url":"https://api.github.com/users/aantron/following{/other_user}","gists_url":"https://api.github.com/users/aantron/gists{/gist_id}","starred_url":"https://api.github.com/users/aantron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aantron/subscriptions","organizations_url":"https://api.github.com/users/aantron/orgs","repos_url":"https://api.github.com/users/aantron/repos","events_url":"https://api.github.com/users/aantron/events{/privacy}","received_events_url":"https://api.github.com/users/aantron/received_events","type":"User","site_admin":false},"created_at":"2018-12-05T09:49:12Z","updated_at":"2018-12-05T09:49:12Z","author_association":"COLLABORATOR","body":"Nice, that's a good idea.\r\n\r\nI'm still concerned, though, about what happens when one calls `borrow` in a loop while there is a value in the mvar, that remains.\r\n\r\nPerhaps we need a `borrow`/`peek` but also a `borrow_next`/`peek_next` function, which always \"blocks\" until the *next* write, even if a value is already available?\r\n\r\nIn combination with `peek_available`, this would allow a peeking reader to check if there is a value now, consume it if desired, then go to \"sleep\" until the next time something can be peeked, if needed.\r\n\r\nIn fact, it seems that these are the two primitives that are needed, and an ordinary `borrow`/`peek` is not needed.\r\n\r\nWhat does everyone think?"}}
{"actor":{"display_login":"aantron"}}