~ubuntu-branches/ubuntu/utopic/ocamlbricks/utopic-proposed

« back to all changes in this revision

Viewing changes to STRUCTURES/cortex_lib.mli

  • Committer: Package Import Robot
  • Author(s): Lucas Nussbaum
  • Date: 2014-07-08 11:09:39 UTC
  • mfrom: (3.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20140708110939-xaex1s3nqepm56eh
Tags: 0.90+bzr400-1
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
    end
135
135
 
136
136
end
 
137
 
 
138
(* 1-position communication channels: *)
 
139
module Channel : sig
 
140
 
 
141
  (* The channel may be empty or it may contain a message for someone *)
 
142
  type 'a t = ('a option) Cortex.t
 
143
 
 
144
  val return :
 
145
    ?equality:('a -> 'a -> bool) ->
 
146
    ?on_proposal:('a option -> 'a option -> 'a option) ->
 
147
    ?on_commit:('a option -> 'a option -> unit) ->
 
148
    ?init:'a ->
 
149
    unit -> 'a t
 
150
 
 
151
  val receive  : 'a t -> 'a
 
152
  val send     : 'a t -> 'a -> bool (* success/failure of sending *)
 
153
 
 
154
end (* Canal *)
 
155
 
 
156
module Clock : sig
 
157
  type t = int Cortex.t
 
158
  val make : ?init:int -> ?limit:int -> ?delay:float -> unit -> t
 
159
end
 
160