{"_id":"58e7577d55d9573b007177b1","parentDoc":null,"project":"5612c2a00fbdb60d00e4c7d1","githubsync":"","user":"5612c290c0731b0d00625078","version":{"_id":"5612c2a00fbdb60d00e4c7d4","__v":7,"project":"5612c2a00fbdb60d00e4c7d1","createdAt":"2015-10-05T18:34:08.611Z","releaseDate":"2015-10-05T18:34:08.611Z","categories":["5612c2a10fbdb60d00e4c7d5","58e6b64bc397de1b00173c09","58e6b68eb1eece19008b81fe","58e6b6d185ec873100be9734","58f5e5c2616bbb1b00d54c15","58f5eaa74c413f19007a2858","58f767a79c723f19004e1ca9"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"0.0.1","version":"0.0.1"},"__v":0,"category":{"_id":"58e6b6d185ec873100be9734","project":"5612c2a00fbdb60d00e4c7d1","version":"5612c2a00fbdb60d00e4c7d4","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-04-06T21:44:49.026Z","from_sync":false,"order":3,"slug":"cluster-operations","title":"Partisan"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-04-07T09:10:21.859Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"For routing messages between nodes, Partisan provides a function called `forward_message`.  This function, given a node name, process identifier or registered name, will forward the message and deliver it into the remote processes mailbox.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"> partisan_peer_service:forward_message(NodeName, RemotePidOrRegisteredName, Message).\\nok\",\n      \"language\": \"erlang\"\n    }\n  ]\n}\n[/block]","excerpt":"How do I use Partisan to route messages between nodes?","slug":"messaging-api","type":"basic","title":"Messaging API"}

Messaging API

How do I use Partisan to route messages between nodes?

For routing messages between nodes, Partisan provides a function called `forward_message`. This function, given a node name, process identifier or registered name, will forward the message and deliver it into the remote processes mailbox. [block:code] { "codes": [ { "code": "> partisan_peer_service:forward_message(NodeName, RemotePidOrRegisteredName, Message).\nok", "language": "erlang" } ] } [/block]