1 ! Copyright (C) 2007 Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: help.syntax help.markup channels concurrency.distributed ;
7 { $values { "node" "a node object" }
8 { "id" "the id of the published channel on the node" }
9 { "remote-channel" remote-channel }
11 { $description "Create a remote channel that acts as a proxy for a "
12 "channel on another node. The remote node's channel must have been "
13 "published using " { $link publish } " and the id should be the id "
14 "returned by " { $link publish }
17 { $code "\"localhost\" 9000 <node> \"ID123456\" <remote-channel> \"foo\" over to" }
19 { $see-also publish unpublish } ;
22 { $values { "id" "a string" }
24 { $description "Stop a previously published channel from being "
25 "accessible by remote nodes."
28 { $code "<channel> publish unpublish" }
30 { $see-also <remote-channel> publish } ;
33 { $values { "channel" "a channel object" }
36 { $description "Make a channel accessible via remote Factor nodes. "
37 "An id is returned that can be used by another node to use "
38 { $link to } " and " { $link from } " to access the channel."
41 { $code "<channel> publish" }
43 { $see-also <remote-channel> unpublish } ;
45 ARTICLE: { "remote-channels" "remote-channels" } "Remote Channels"
46 "Remote channels are channels that can be accessed by other Factor instances. It uses distributed concurrency to serialize and send data between channels."
48 "To start a remote node, distributed concurrency must have been started. This can be done using " { $link start-node } "."
50 { $snippet "\"myhost.com\" 9001 start-node" }
52 "Once the node is started, channels can be published using " { $link publish }
53 " to be accessed remotely. " { $link publish } " returns an id which a remote node "
54 "needs to know to access the channel."
56 { $snippet "channel [ from . ] spawn drop dup publish" }
58 "Given the id from the snippet above, a remote node can put items in the channel."
60 { $snippet "\"myhost.com\" 9001 <node> \"ID123456\" <remote-channel>\n\"hello\" over to" }
63 ABOUT: { "remote-channels" "remote-channels" }