sig
type param_value =
[ `Bool of bool | `Float of float | `Int of int | `String of string ]
type param_value_or_any =
[ `Any of exn
| `Bool of bool
| `Float of float
| `Int of int
| `String of string ]
type level =
[ `Alert | `Crit | `Debug | `Emerg | `Err | `Info | `Notice | `Warning ]
class type logger =
object
method log :
component:string ->
level:Netplex_types.level -> message:string -> unit
method max_level : Netplex_types.level
method reopen : unit -> unit
method set_max_level : Netplex_types.level -> unit
end
type parallelization_type =
[ `Controller_attached | `Multi_processing | `Multi_threading ]
type socket_state = [ `Disabled | `Down | `Enabled | `Restarting of bool ]
type container_id = < >
type container_state =
[ `Accepting of int * float
| `Busy
| `Shutting_down
| `Starting of float ]
type capacity =
[ `Low_quality of int | `Normal_quality of int | `Unavailable ]
class type controller =
object
method add_admin : (Rpc_server.t -> unit) -> unit
method add_service :
Netplex_types.socket_service ->
Netplex_types.workload_manager -> unit
method controller_config : Netplex_types.controller_config
method event_system : Unixqueue.unix_event_system
method logger : Netplex_types.logger
method ptype : Netplex_types.parallelization_type
method restart : unit -> unit
method services :
(Netplex_types.socket_service * Netplex_types.socket_controller *
Netplex_types.workload_manager)
list
method shutdown : unit -> unit
end
and controller_config =
object
method create_logger : Netplex_types.controller -> Netplex_types.logger
method socket_directory : string
end
and socket_service =
object
method create_container :
Netplex_types.parallelization_type ->
Netplex_types.socket_service -> Netplex_types.container
method name : string
method processor : Netplex_types.processor
method socket_service_config : Netplex_types.socket_service_config
method sockets : (string * Unix.file_descr array) list
end
and socket_service_config =
object
method change_user_to : (int * int) option
method name : string
method protocols : Netplex_types.protocol list
end
and protocol =
object
method addresses : Unix.sockaddr array
method configure_slave_socket : Unix.file_descr -> unit
method lstn_backlog : int
method lstn_reuseaddr : bool
method name : string
method so_keepalive : bool
end
and socket_controller =
object
method container_state :
(Netplex_types.container_id * Netplex_types.container_state * bool)
list
method disable : unit -> unit
method enable : unit -> unit
method restart : unit -> unit
method shutdown : unit -> unit
method start_containers : int -> unit
method state : Netplex_types.socket_state
method stop_containers : Netplex_types.container_id list -> unit
end
and processor_hooks =
object
method global_exception_handler : exn -> bool
method post_add_hook : Netplex_types.socket_service -> unit
method post_finish_hook :
Netplex_types.socket_service ->
Netplex_types.controller -> Netplex_types.container_id -> unit
method post_rm_hook : Netplex_types.socket_service -> unit
method post_start_hook : Netplex_types.container -> unit
method pre_finish_hook : Netplex_types.container -> unit
method pre_start_hook :
Netplex_types.socket_service ->
Netplex_types.controller -> Netplex_types.container_id -> unit
method receive_admin_message :
Netplex_types.container -> string -> string array -> unit
method receive_message :
Netplex_types.container -> string -> string array -> unit
method shutdown : unit -> unit
end
and processor =
object
method global_exception_handler : exn -> bool
method post_add_hook : Netplex_types.socket_service -> unit
method post_finish_hook :
Netplex_types.socket_service ->
Netplex_types.controller -> Netplex_types.container_id -> unit
method post_rm_hook : Netplex_types.socket_service -> unit
method post_start_hook : Netplex_types.container -> unit
method pre_finish_hook : Netplex_types.container -> unit
method pre_start_hook :
Netplex_types.socket_service ->
Netplex_types.controller -> Netplex_types.container_id -> unit
method process :
when_done:(unit -> unit) ->
Netplex_types.container -> Unix.file_descr -> string -> unit
method receive_admin_message :
Netplex_types.container -> string -> string array -> unit
method receive_message :
Netplex_types.container -> string -> string array -> unit
method shutdown : unit -> unit
method supported_ptypes : Netplex_types.parallelization_type list
end
and container =
object
method event_system : Unixqueue.unix_event_system
method log : Netplex_types.level -> string -> unit
method lookup : string -> string -> string option
method ptype : Netplex_types.parallelization_type
method send_message : string -> string -> string array -> unit
method set_var : string -> Netplex_types.param_value_or_any -> unit
method shutdown : unit -> unit
method socket_service : Netplex_types.socket_service
method start : Unix.file_descr -> Unix.file_descr -> unit
method system : Rpc_client.t
method var : string -> Netplex_types.param_value_or_any
end
and workload_manager =
object
method adjust :
Netplex_types.socket_service ->
Netplex_types.socket_controller -> unit
method capacity :
Netplex_types.container_id ->
Netplex_types.container_state -> Netplex_types.capacity
method hello : Netplex_types.controller -> unit
method shutdown : unit -> unit
end
class type par_thread =
object
method info_string : string
method parallelizer : Netplex_types.parallelizer
method ptype : Netplex_types.parallelization_type
method sys_id : [ `Process of int | `Thread of int ]
method watch_shutdown : Unixqueue.unix_event_system -> unit
end
and parallelizer =
object
method create_mem_mutex : unit -> (unit -> unit) * (unit -> unit)
method current_sys_id : [ `Process of int | `Thread of int ]
method init : unit -> unit
method ptype : Netplex_types.parallelization_type
method start_thread :
(Netplex_types.par_thread -> unit) ->
Unix.file_descr list ->
string -> Netplex_types.logger -> Netplex_types.par_thread
end
type config_tree =
[ `Parameter of
Netplex_types.address * string * Netplex_types.param_value
| `Section of
Netplex_types.address * string * Netplex_types.config_tree list ]
and address = < >
class type config_file =
object
method bool_param : Netplex_types.address -> bool
method filename : string
method float_param : Netplex_types.address -> float
method int_param : Netplex_types.address -> int
method print : Netplex_types.address -> string
method resolve_parameter :
Netplex_types.address -> string -> Netplex_types.address
method resolve_section :
Netplex_types.address -> string -> Netplex_types.address list
method restrict_parameters :
Netplex_types.address -> string list -> unit
method restrict_subsections :
Netplex_types.address -> string list -> unit
method root_addr : Netplex_types.address
method root_name : string
method string_param : Netplex_types.address -> string
method tree : Netplex_types.config_tree
end
class type processor_factory =
object
method create_processor :
Netplex_types.controller_config ->
Netplex_types.config_file ->
Netplex_types.address -> Netplex_types.processor
method name : string
end
class type workload_manager_factory =
object
method create_workload_manager :
Netplex_types.controller_config ->
Netplex_types.config_file ->
Netplex_types.address -> Netplex_types.workload_manager
method name : string
end
class type logger_factory =
object
method create_logger :
Netplex_types.config_file ->
Netplex_types.address ->
Netplex_types.controller -> Netplex_types.logger
method name : string
end
class type netplex_config =
object
method controller_config : Netplex_types.controller_config
method ptype : Netplex_types.parallelization_type
method services :
(Netplex_types.socket_service_config *
(Netplex_types.address * Netplex_types.processor_factory) *
(Netplex_types.address * Netplex_types.workload_manager_factory))
list
end
end