Thank you your detailed description about system-entity being sited.
Here is another related issue.
I have a class which has some methods like this:
Pr = System.showInfo
class A_class
meth {M1 P ...}
{Pr "---checking"}
{Do_something ...}
{Pr "---Status: ..."}
end
end
--------------------------------------------
I have this class running successfully on a machine A.
Now, I want it to run on machine B and watch the result on
machine A.
I understand that in general I could embed the class object
behind a stream/port entity on machine B.
Then I send a message from machine A to the port on machine B.
But what about those 'status-report-type print' statement
{Pr "status.."} inside those methods ??
Ideally, I want to see the status report on machine A's screen.
Any way to deal with this?
thanks
HP
On Wed, 4 Aug 2010, Wolfgang Meyer wrote:
Hi,
"OS" is a system module (although pre-imported in the Emacs OPI) and
as such is "sited". See
http://www.mozart-oz.org/documentation/dstutorial/node2.html#sited.entities
for an explanation.
.....
Another possibility (closer to your original example) is to distribute
a port instead of a function. In this way you can make sure that
"OS.system" is executed on the correct machine.
Machine A:
declare P T in
thread
Stream
in
P = {Port.new ?Stream}
for Command#Result in Stream do
Result = {OS.system Command}
end
end
{Connection.offerUnlimited P T}
{Show T} % cut-and-paste this output into the following
Machine B:
local P Result in
P = {Connection.take 'oz-ticket://...'} % copy ticket here
Result = {Port.sendRecv P "ls /a/path"}
{Inspect Result}
end
...
Cheers,
Wolfgang
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users