allow setting of hostname in start-node of concurrency

chris.double 2006-08-31 11:23:19 +00:00
parent 9726e6fbd0
commit 941a1688ba
1 changed files with 5 additions and 7 deletions

View File

@ -501,9 +501,9 @@ PREDICATE: tagged-message (get-msg) ( obj -- ? )
: send-to-node ( msg pid host port -- )
<client> [ 2array [ serialize ] with-serialized ] with-stream ;
: start-node ( port -- )
: start-node ( hostname port -- )
[ node-server ] in-thread
"localhost" swap <node> \ localnode set-global ;
<node> \ localnode set-global ;
M: remote-process send ( message process -- )
#! Send the message via the inter-node protocol
@ -518,11 +518,9 @@ M: process serialize ( obj -- )
: (test-node1)
receive "ack" reply (test-node1) ;
: test-node1
9000 start-node
: test-node1 ( -- )
[ (test-node1) ] spawn
"test1" swap register-process ;
: test-node2
localnode [ 9001 start-node ] unless
[ "abcd" "localhost" 9000 <node> "test1" <remote-process> send-synchronous . ] spawn ;
: test-node2 ( hostname port -- )
[ <node> "test1" <remote-process> "message" swap send-synchronous . ] spawn 2drop ;