{"action":"opened","issue":{"url":"https://api.github.com/repos/ethanrowe/flowz/issues/14","repository_url":"https://api.github.com/repos/ethanrowe/flowz","labels_url":"https://api.github.com/repos/ethanrowe/flowz/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/ethanrowe/flowz/issues/14/comments","events_url":"https://api.github.com/repos/ethanrowe/flowz/issues/14/events","html_url":"https://github.com/ethanrowe/flowz/issues/14","id":160022505,"number":14,"title":"Observe the values on a channel","user":{"login":"ethanrowe","id":62431,"avatar_url":"https://avatars.githubusercontent.com/u/62431?v=3","gravatar_id":"","url":"https://api.github.com/users/ethanrowe","html_url":"https://github.com/ethanrowe","followers_url":"https://api.github.com/users/ethanrowe/followers","following_url":"https://api.github.com/users/ethanrowe/following{/other_user}","gists_url":"https://api.github.com/users/ethanrowe/gists{/gist_id}","starred_url":"https://api.github.com/users/ethanrowe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethanrowe/subscriptions","organizations_url":"https://api.github.com/users/ethanrowe/orgs","repos_url":"https://api.github.com/users/ethanrowe/repos","events_url":"https://api.github.com/users/ethanrowe/events{/privacy}","received_events_url":"https://api.github.com/users/ethanrowe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-13T19:08:22Z","updated_at":"2016-06-13T19:08:22Z","closed_at":null,"body":"For purposes of logging, metrics, debugging, etc., it's helpful to be able to watch the values on a channel without doing anything to those values.\r\n\r\nSo what I want is an ``ObserveChannel``, that, given an input channel and some callable, passes each input channel value (on read) to the callable, and then emits that input channel value unchanged.\r\n\r\nThus I can observe the values in the channel and react to them (with side effects!  Hoo boy!  Yippee!  Skippee!), without \"interfering\" with them.\r\n\r\nFor instance:\r\n\r\n```python\r\na = IterChannel(range(5))\r\n# Will emit 0, 1, 4, 9, 16\r\nb = a.map(lambda i: i ** 2)\r\n```\r\n\r\nversus the functionally equivalent (but different in terms of I/O)\r\n\r\n```python\r\nfrom __future__ import print_function\r\na = IterChannel(range(5))\r\n# Will emit 0, 1, 4, 9, 16, but will also print them.\r\nb = a.map(lambda i: i ** 2).observe(print)\r\n```"}}
{"actor":{"display_login":"ethanrowe"}}