{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/425","repository_url":"https://api.github.com/repos/mozilla-mobile/android-components","labels_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/425/labels{/name}","comments_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/425/comments","events_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/425/events","html_url":"https://github.com/mozilla-mobile/android-components/pull/425","id":341510045,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxNjMwNTQ5","number":425,"title":"RFC: Adding \"consumable\" properties to Session.","user":{"login":"pocmo","id":89638,"node_id":"MDQ6VXNlcjg5NjM4","avatar_url":"https://avatars0.githubusercontent.com/u/89638?v=4","gravatar_id":"","url":"https://api.github.com/users/pocmo","html_url":"https://github.com/pocmo","followers_url":"https://api.github.com/users/pocmo/followers","following_url":"https://api.github.com/users/pocmo/following{/other_user}","gists_url":"https://api.github.com/users/pocmo/gists{/gist_id}","starred_url":"https://api.github.com/users/pocmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pocmo/subscriptions","organizations_url":"https://api.github.com/users/pocmo/orgs","repos_url":"https://api.github.com/users/pocmo/repos","events_url":"https://api.github.com/users/pocmo/events{/privacy}","received_events_url":"https://api.github.com/users/pocmo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-07-16T13:03:39Z","updated_at":"2018-07-17T14:30:32Z","closed_at":"2018-07-17T14:30:32Z","author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/mozilla-mobile/android-components/pulls/425","html_url":"https://github.com/mozilla-mobile/android-components/pull/425","diff_url":"https://github.com/mozilla-mobile/android-components/pull/425.diff","patch_url":"https://github.com/mozilla-mobile/android-components/pull/425.patch"},"body":"(This PR is not for merging - only for discussion).\r\n\r\nI would like to add properties to Session that are _consumable_. This means when setting the value of a _consumable property_ an `Observer` can decide to consume it. This means the value won't be set on `Session` and the property value will be `null`. If the value is not consumed then it will be set and can be read from `Session` to be consumed later.\r\n\r\nSome properties like a `Download` are something that an observer processes and then there is no need to keep a reference to the value anymore. Sometimes the value can't be processed immediately (e.g. we need to request a permission first) and then it is helpful to store it in `Session` to be consumed later. There will be more properties in the future that following this _consumer_ pattern.\r\n\r\nThe following PR implements this behavior for a Download. The PR is not complete to be actually merged.\r\n\r\nI would like to make it more clear that this property can/should be consumed. For the observer case it's clear. But when consuming this property later a _processor_ would need to read (is it null?), then process, then set it to `null` which is not super nice."},"comment":{"url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/comments/405602714","html_url":"https://github.com/mozilla-mobile/android-components/pull/425#issuecomment-405602714","issue_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/425","id":405602714,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNTYwMjcxNA==","user":{"login":"pocmo","id":89638,"node_id":"MDQ6VXNlcjg5NjM4","avatar_url":"https://avatars0.githubusercontent.com/u/89638?v=4","gravatar_id":"","url":"https://api.github.com/users/pocmo","html_url":"https://github.com/pocmo","followers_url":"https://api.github.com/users/pocmo/followers","following_url":"https://api.github.com/users/pocmo/following{/other_user}","gists_url":"https://api.github.com/users/pocmo/gists{/gist_id}","starred_url":"https://api.github.com/users/pocmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pocmo/subscriptions","organizations_url":"https://api.github.com/users/pocmo/orgs","repos_url":"https://api.github.com/users/pocmo/repos","events_url":"https://api.github.com/users/pocmo/events{/privacy}","received_events_url":"https://api.github.com/users/pocmo/received_events","type":"User","site_admin":false},"created_at":"2018-07-17T14:30:32Z","updated_at":"2018-07-17T14:30:32Z","author_association":"COLLABORATOR","body":"@csadilek Okay, in this case I'll continue and implement the missing pieces. Closing this PR for now. :)"}}
{"actor":{"display_login":"pocmo"}}