{"action":"opened","issue":{"url":"https://api.github.com/repos/ricejasonf/nbdl/issues/11","repository_url":"https://api.github.com/repos/ricejasonf/nbdl","labels_url":"https://api.github.com/repos/ricejasonf/nbdl/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/ricejasonf/nbdl/issues/11/comments","events_url":"https://api.github.com/repos/ricejasonf/nbdl/issues/11/events","html_url":"https://github.com/ricejasonf/nbdl/issues/11","id":137005270,"number":11,"title":"[context] Push Messages","user":{"login":"ricejasonf","id":2257044,"avatar_url":"https://avatars.githubusercontent.com/u/2257044?v=3","gravatar_id":"","url":"https://api.github.com/users/ricejasonf","html_url":"https://github.com/ricejasonf","followers_url":"https://api.github.com/users/ricejasonf/followers","following_url":"https://api.github.com/users/ricejasonf/following{/other_user}","gists_url":"https://api.github.com/users/ricejasonf/gists{/gist_id}","starred_url":"https://api.github.com/users/ricejasonf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricejasonf/subscriptions","organizations_url":"https://api.github.com/users/ricejasonf/orgs","repos_url":"https://api.github.com/users/ricejasonf/repos","events_url":"https://api.github.com/users/ricejasonf/events{/privacy}","received_events_url":"https://api.github.com/users/ricejasonf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ricejasonf/nbdl/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-28T04:20:04Z","updated_at":"2016-02-28T04:20:04Z","closed_at":null,"body":"Figure out how poviders and consumers can push messages to the context. Ideally, providers should be limited to creating downstream messages, and consumers should be limited to creating upstream messages.\r\n\r\nSomething like this only maybe less object oriented:\r\n```cpp\r\ntemplate<\r\n  typename ProviderMap,\r\n  typename Consumers,\r\n  typename StoreMap>\r\nclass Context\r\n{\r\n  ProviderMap providers;\r\n  Consumers consumers;\r\n  StoreMap stores;\r\n\r\n  // should be callable only by providers\r\n  template<typename Message>\r\n  auto pushDownstream(Message&&)\r\n  {\r\n    // access providers, consumers and stores\r\n  }\r\n\r\n  // should be callable only by consumers\r\n  template<typename Message>\r\n  auto pushUpstream(Message&&)\r\n  {\r\n    // access providers, consumers and stores\r\n  }\r\n\r\n  public:\r\n\r\n};\r\n\r\n```"}}