{"action":"created","issue":{"url":"https://api.github.com/repos/holochain/holochain-rust/issues/746","repository_url":"https://api.github.com/repos/holochain/holochain-rust","labels_url":"https://api.github.com/repos/holochain/holochain-rust/issues/746/labels{/name}","comments_url":"https://api.github.com/repos/holochain/holochain-rust/issues/746/comments","events_url":"https://api.github.com/repos/holochain/holochain-rust/issues/746/events","html_url":"https://github.com/holochain/holochain-rust/pull/746","id":390002035,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3ODY1MTk2","number":746,"title":"Node-to-node send/receive","user":{"login":"lucksus","id":311749,"node_id":"MDQ6VXNlcjMxMTc0OQ==","avatar_url":"https://avatars0.githubusercontent.com/u/311749?v=4","gravatar_id":"","url":"https://api.github.com/users/lucksus","html_url":"https://github.com/lucksus","followers_url":"https://api.github.com/users/lucksus/followers","following_url":"https://api.github.com/users/lucksus/following{/other_user}","gists_url":"https://api.github.com/users/lucksus/gists{/gist_id}","starred_url":"https://api.github.com/users/lucksus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lucksus/subscriptions","organizations_url":"https://api.github.com/users/lucksus/orgs","repos_url":"https://api.github.com/users/lucksus/repos","events_url":"https://api.github.com/users/lucksus/events{/privacy}","received_events_url":"https://api.github.com/users/lucksus/received_events","type":"User","site_admin":false},"labels":[{"id":937673517,"node_id":"MDU6TGFiZWw5Mzc2NzM1MTc=","url":"https://api.github.com/repos/holochain/holochain-rust/labels/review","name":"review","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-11T23:39:39Z","updated_at":"2018-12-12T13:11:10Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/holochain/holochain-rust/pulls/746","html_url":"https://github.com/holochain/holochain-rust/pull/746","diff_url":"https://github.com/holochain/holochain-rust/pull/746.diff","patch_url":"https://github.com/holochain/holochain-rust/pull/746.patch"},"body":"# Usage\r\nDefine receive callback in `define_zome!` next to `genesis`:\r\n```rust\r\ndefine_zome! {\r\n...\r\n    genesis: || { Ok(()) }\r\n\r\n    receive: |payload| {\r\n        format!(\"Received: {}\", payload)\r\n    }\r\n\r\n    functions: {\r\n```\r\n\r\nUse `hdk::send` to asynchronously send and receive the return value of the `receive` callback from the other node:\r\n```rust\r\nfn handle_send_message(to_agent: Address, message: String) -> String {\r\n    match hdk::send(to_agent, message) {\r\n        Ok(response) => response,\r\n        Err(error) => error.to_string(),\r\n    }\r\n}\r\n```\r\n\r\nYes, you can have a receive callback in each zome. `hdk::send` calls only map to the receive callback of the zome in which send gets called.\r\n\r\n# Chunks\r\n* `receive` added to `define_zome!` macro\r\n* `CustomDirectMessage` added\r\n* hc_send/invoke_send implemented\r\n* custom_send action creator and Future that waits for the result to appear in the (network) state\r\n* `handle_custom_direct_message` workflow that runs on the receiving end, calls the callback and dispatches an action to send the response"},"comment":{"url":"https://api.github.com/repos/holochain/holochain-rust/issues/comments/446582865","html_url":"https://github.com/holochain/holochain-rust/pull/746#issuecomment-446582865","issue_url":"https://api.github.com/repos/holochain/holochain-rust/issues/746","id":446582865,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NjU4Mjg2NQ==","user":{"login":"codecov[bot]","id":22429695,"node_id":"MDM6Qm90MjI0Mjk2OTU=","avatar_url":"https://avatars2.githubusercontent.com/in/254?v=4","gravatar_id":"","url":"https://api.github.com/users/codecov%5Bbot%5D","html_url":"https://github.com/apps/codecov","followers_url":"https://api.github.com/users/codecov%5Bbot%5D/followers","following_url":"https://api.github.com/users/codecov%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/codecov%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/codecov%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codecov%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/codecov%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/codecov%5Bbot%5D/repos","events_url":"https://api.github.com/users/codecov%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/codecov%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-12-12T13:11:10Z","updated_at":"2018-12-12T13:11:10Z","author_association":"NONE","body":"# [Codecov](https://codecov.io/gh/holochain/holochain-rust/pull/746?src=pr&el=h1) Report\n> Merging [#746](https://codecov.io/gh/holochain/holochain-rust/pull/746?src=pr&el=desc) into [develop](https://codecov.io/gh/holochain/holochain-rust/commit/24a32f4a506c47ac11471d4addcaa4c0ffa8a02d?src=pr&el=desc) will **decrease** coverage by `1.12%`.\n> The diff coverage is `22.34%`.\n\n[![Impacted file tree graph](https://codecov.io/gh/holochain/holochain-rust/pull/746/graphs/tree.svg?width=650&token=PSGycww1H6&height=150&src=pr)](https://codecov.io/gh/holochain/holochain-rust/pull/746?src=pr&el=tree)\n\n```diff\n@@             Coverage Diff             @@\n##           develop     #746      +/-   ##\n===========================================\n- Coverage    73.31%   72.19%   -1.11%     \n===========================================\n  Files          138      142       +4     \n  Lines         4690     4789      +99     \n===========================================\n+ Hits          3438     3457      +19     \n- Misses        1252     1332      +80\n```\n\n\n| [Impacted Files](https://codecov.io/gh/holochain/holochain-rust/pull/746?src=pr&el=tree) | Coverage Δ | |\n|---|---|---|\n| [core/src/action.rs](https://codecov.io/gh/holochain/holochain-rust/pull/746/diff?src=pr&el=tree#diff-Y29yZS9zcmMvYWN0aW9uLnJz) | `100% <ø> (ø)` | :arrow_up: |\n| [hdk-rust/src/api.rs](https://codecov.io/gh/holochain/holochain-rust/pull/746/diff?src=pr&el=tree#diff-aGRrLXJ1c3Qvc3JjL2FwaS5ycw==) | `0% <ø> (ø)` | :arrow_up: |\n| [core/src/nucleus/ribosome/callback/mod.rs](https://codecov.io/gh/holochain/holochain-rust/pull/746/diff?src=pr&el=tree#diff-Y29yZS9zcmMvbnVjbGV1cy9yaWJvc29tZS9jYWxsYmFjay9tb2QucnM=) | `67.17% <0%> (ø)` | :arrow_up: |\n| [...rc/network/reducers/handle\\_custom\\_send\\_response.rs](https://codecov.io/gh/holochain/holochain-rust/pull/746/diff?src=pr&el=tree#diff-Y29yZS9zcmMvbmV0d29yay9yZWR1Y2Vycy9oYW5kbGVfY3VzdG9tX3NlbmRfcmVzcG9uc2UucnM=) | `0% <0%> (ø)` | |\n| [core/src/network/reducers/mod.rs](https://codecov.io/gh/holochain/holochain-rust/pull/746/diff?src=pr&el=tree#diff-Y29yZS9zcmMvbmV0d29yay9yZWR1Y2Vycy9tb2QucnM=) | `95.13% <0%> (-2.43%)` | :arrow_down: |\n| [core/src/network/reducers/send\\_direct\\_message.rs](https://codecov.io/gh/holochain/holochain-rust/pull/746/diff?src=pr&el=tree#diff-Y29yZS9zcmMvbmV0d29yay9yZWR1Y2Vycy9zZW5kX2RpcmVjdF9tZXNzYWdlLnJz) | `78.95% <0%> (-9.28%)` | :arrow_down: |\n| [core/src/network/actions/custom\\_send.rs](https://codecov.io/gh/holochain/holochain-rust/pull/746/diff?src=pr&el=tree#diff-Y29yZS9zcmMvbmV0d29yay9hY3Rpb25zL2N1c3RvbV9zZW5kLnJz) | `0% <0%> (ø)` | |\n| [core/src/nucleus/ribosome/api/send.rs](https://codecov.io/gh/holochain/holochain-rust/pull/746/diff?src=pr&el=tree#diff-Y29yZS9zcmMvbnVjbGV1cy9yaWJvc29tZS9hcGkvc2VuZC5ycw==) | `0% <0%> (ø)` | |\n| [core/src/workflows/handle\\_custom\\_direct\\_message.rs](https://codecov.io/gh/holochain/holochain-rust/pull/746/diff?src=pr&el=tree#diff-Y29yZS9zcmMvd29ya2Zsb3dzL2hhbmRsZV9jdXN0b21fZGlyZWN0X21lc3NhZ2UucnM=) | `0% <0%> (ø)` | |\n| [core/src/network/state.rs](https://codecov.io/gh/holochain/holochain-rust/pull/746/diff?src=pr&el=tree#diff-Y29yZS9zcmMvbmV0d29yay9zdGF0ZS5ycw==) | `100% <100%> (ø)` | :arrow_up: |\n| ... and [8 more](https://codecov.io/gh/holochain/holochain-rust/pull/746/diff?src=pr&el=tree-more) | |\n\n------\n\n[Continue to review full report at Codecov](https://codecov.io/gh/holochain/holochain-rust/pull/746?src=pr&el=continue).\n> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)\n> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`\n> Powered by [Codecov](https://codecov.io/gh/holochain/holochain-rust/pull/746?src=pr&el=footer). Last update [24a32f4...77444f3](https://codecov.io/gh/holochain/holochain-rust/pull/746?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).\n"}}
{"actor":{"display_login":"codecov"}}