Swim.Types.Wire

swim · API reference

type message_type = 
  | Ping_msg
  | Indirect_ping_msg
  | Ack_resp_msg
  | Suspect_msg
  | Alive_msg
  | Dead_msg
  | Push_pull_msg
  | Compound_msg
  | User_msg
  | Compress_msg
  | Encrypt_msg
  | Nack_resp_msg
  | Has_crc_msg
  | Err_msg
  | Has_label_msg
val message_type_to_int : message_type -> int
val message_type_of_int : int -> (message_type, int) result
type ping = {
  seq_no : int;
  node : string;
  source_addr : string;
  source_port : int;
  source_node : string;
}
type indirect_ping_req = {
  seq_no : int;
  target : string;
  port : int;
  node : string;
  nack : bool;
  source_addr : string;
  source_port : int;
  source_node : string;
}
type ack_resp = {
  seq_no : int;
  payload : string;
}
type nack_resp = {
  seq_no : int;
}
type suspect = {
  incarnation : int;
  node : string;
  from : string;
}
type alive = {
  incarnation : int;
  node : string;
  addr : string;
  port : int;
  meta : string;
  vsn : int list;
}
type dead = {
  incarnation : int;
  node : string;
  from : string;
}
type compress = {
  algo : int;
  buf : string;
}
type push_pull_header = {
  pp_nodes : int;
  pp_user_state_len : int;
  pp_join : bool;
}
type push_node_state = {
  pns_name : string;
  pns_addr : string;
  pns_port : int;
  pns_meta : string;
  pns_incarnation : int;
  pns_state : int;
  pns_vsn : int list;
}
type protocol_msg = 
  | Ping of ping
  | Indirect_ping of indirect_ping_req
  | Ack of ack_resp
  | Nack of nack_resp
  | Suspect of suspect
  | Alive of alive
  | Dead of dead
  | User_data of string
  | Compound of string list
  | Compressed of compress
  | Err of string