List of Import References :
See BOOL
See Com
See DENOTATION
See Nat
See Option
See Seq
See Void
This structure provides a model for agent communication based on the client / server approach. Client and servers communicate via so-called service access points (SAPs).
SIGNATURE ComService[in, out]
$Date: 2010-09-30 18:24:17 +0200 (Do, 30. Sep 2010) $ ($Revision: 616 $)
SORT in out IMPORT Com[in] ONLY com Com[out] ONLY com Com[sap] ONLY com Void ONLY void
A new service access point is created with the following command:
SORT sap FUN sap : com[sap]
A service is requested and provided on a SAP with the following functions:
FUN @ : sap ** in -> com[out] FUN => : sap ** (in -> bool) ** (in -> com[out]) -> com[out] FUN => : sap ** (in -> com[out]) -> com[out]
In SAP @ Data ; Cont
, the value Data
specifies the
input data to be communicated to a server providing
services on the SAP. The continuation Cont
will be executed
with the result of the service, which is communicated back from
the server to the client.
In (SAP, Cond) => Service ; Cont
the function Cond
specifies a condition to be satisfied by the input of a client,
such that Service
will be provided to that client. The answer of
executing Service(Data)
will be communicated as the services result
to the client, and will also be passed to the continuation Cont
of
the server. The variant SAP => Service ; Cont
is a shortcut
for (SAP, \\ _ . true) => Service ; Cont
.
Both commands may be used in a choice. They are enabled if a pair of server and clients on the given SAP exists such that the clients data satifies the servers condition. After enabling, client and server are in the state of a rendezvous. A rendezvous durates as long as the service needs to be executed. During the rendezvous the client is suspended but the server may be invoked in arbitrary other communcation.
If a server is killed during a rendezvous, the associated client
will return from its request with a specific failure answer. This answer
can be checked with function killed?'Agent
.
next node: ComServiceConv,
prev node: ComAgentConv,
up to node: Subsystem Concurrent Opal