| << Prev | - Up - |
bla..
Here follows a list of precompiled applications
Name | Status | Author |
|---|---|---|
GO - a japanese borad game | comming soon | Lars Rasmusson |
Chat | comming soon | Lars Rasmusson |
Chess | comming soon | Nils Franzen |
Multi-worms | comming soon | Simon Lindblom |
This section describes the interface for writing your own applications. The code for an application consists of two parts, a server-part and a client-part. The design of the application interface was to keep it small and clean. We do not force the application programmer to adapt to some to distribution scheme, rather we use the most basic primitives for distribution that the system provides: Tickets.
The MM system provides a way to distributing tickets and starting functors on different sites.
I will show a small program, which demonstrate the interface. This program can be used as a skeleton for your own applications later.
The server will start in a separate thread
functor
import
Connection
export
start:Start
stop:Stop
define
Gate
proc{Start U Ticket}
fun{P C} U.name#" say, Hello "#C.name end
in
Gate={New Connection.gate init(P Ticket)}
end
proc{Stop}
{Gate close()}
end
end
The MM-client will call application client module with an instaciated ticket Ticket and the name of the person
functor
import
Browser(browse)
Connection(take)
export
start:Start
stop:Stop
define
proc{Start U T}
S={Connection.take T}
in
{Browser.browse {S U}}
end
proc{Stop}
skip
end
end
Testing is allways necessary:)
Warning:Rewrite the test, using module managers instead...
functor
import
Application
Server at './server.ozf'
Client at './client.ozf'
define
U1=user(name:"Nils Franzen" id:nilsf)
U2=user(name:"Simon Lindblom" id:simon)
Ticket
in
Ticket={Server.start U1}
{Client.start U2 Ticket}
{Delay 10000}
{Client.stop}
{Server.stop}
{Application.exit 0}
end| << Prev | - Up - |