[MLton-commit] r6923
Vesa Karvonen
vesak at mlton.org
Mon Oct 13 01:56:50 PDT 2008
Documented minimally.
----------------------------------------------------------------------
U mltonlib/trunk/org/mlton/vesak/rpc-lib/unstable/public/client/client.sig
U mltonlib/trunk/org/mlton/vesak/rpc-lib/unstable/public/server/server.sig
----------------------------------------------------------------------
Modified: mltonlib/trunk/org/mlton/vesak/rpc-lib/unstable/public/client/client.sig
===================================================================
--- mltonlib/trunk/org/mlton/vesak/rpc-lib/unstable/public/client/client.sig 2008-10-13 08:11:10 UTC (rev 6922)
+++ mltonlib/trunk/org/mlton/vesak/rpc-lib/unstable/public/client/client.sig 2008-10-13 08:56:34 UTC (rev 6923)
@@ -4,21 +4,46 @@
* See the LICENSE file or http://mlton.org/License for details.
*)
+(**
+ * Signature for the {Client} module for programming RPC clients.
+ *)
signature CLIENT = sig
exception Unknown
+ (**
+ * Raised when an attempt is made to call a declared procedure that is
+ * not defined on the server.
+ *)
+
exception ProtocolMismatch
+ (**
+ * Raised during the connection process if the server doesn't support
+ * the protocol of the client.
+ *)
structure Conn : sig
type t
+ (** The type of server connections. *)
+
val close : t Effect.t
+ (** Explicitly closes the connection. *)
+
val byName : {host : String.t, port : Int.t} -> t
+ (** Connects to the server on the specified host and port. *)
+
(*val spawn : {exe : String.t, port : Int.t} -> t*)
end
structure Reply : sig
type 'a t
+ (** Type of asynchronous replies. *)
+
val sync : 'a t -> 'a
+ (** Waits for the asynchronous reply and returns it. *)
end
val declare : 'd Rep.t * 'c Rep.t * String.t -> Conn.t -> 'd -> 'c Reply.t
+ (**
+ * Declares a procedure with the given signature {(dom, cod, name)} and
+ * allows it to be called through the given connection.
+ *)
end
Modified: mltonlib/trunk/org/mlton/vesak/rpc-lib/unstable/public/server/server.sig
===================================================================
--- mltonlib/trunk/org/mlton/vesak/rpc-lib/unstable/public/server/server.sig 2008-10-13 08:11:10 UTC (rev 6922)
+++ mltonlib/trunk/org/mlton/vesak/rpc-lib/unstable/public/server/server.sig 2008-10-13 08:56:34 UTC (rev 6923)
@@ -4,8 +4,19 @@
* See the LICENSE file or http://mlton.org/License for details.
*)
+(**
+ * Signature for the {Server} module for programming RPC servers.
+*)
signature SERVER = sig
- val run : {port : Int.t,
- accept : INetSock.sock_addr UnPr.t} Effect.t
val define : 'd Rep.t * 'c Rep.t * String.t -> ('d -> 'c) Effect.t
+ (**
+ * Defines a procedure with the given signature {(dom, cod, name)} and
+ * implementation as callable via RPC.
+ *)
+
+ val run : {port : Int.t, accept : INetSock.sock_addr UnPr.t} Effect.t
+ (**
+ * Starts the server process listening on the specified port for
+ * clients.
+ *)
end
More information about the MLton-commit
mailing list