summaryrefslogtreecommitdiff
path: root/src/proto.ml
blob: df4194449e551e7cc4018242b9e6a1361652f452 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
open Util

(* Protocol definitions *)

type task = unit -> unit
type msg_task = string -> unit

type task_descr = string
type msg_task_descr = string

exception ProtocolError of string

type message =
	| Hello
	| Output of string
	| Get of id * msg_task_descr
	| Put of id * string
	| RequestTask
	| GiveTask of task_descr 
	| GiveMsgTask of string * msg_task_descr
	| FinalResult of string
	

(* Protocol for pooling *)

type pool_message =
	| PoolHello
	| PoolProvide of int
	| PoolRequest of string * (string * int) * int