Ocamlnet 3 Reference Manual : Netplex_types

`sig
type encap = Netplex_encap.encap
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
| `Encap of Netplex_types.encap
| `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 log_subch :
component:string ->
subchannel:string ->
level:Netplex_types.level -> message:string -> unit
method reopen : unit -> unit
end
type parallelization_type =
[ `Controller_attached | `Multi_processing | `Multi_threading ]
type thread_sys_id = [ `Process of int | `Thread of int ]
type socket_state = [ `Disabled | `Down | `Enabled | `Restarting of bool ]
type container_id = < socket_service_name : string >
type container_state =
[ `Accepting of int * float
| `Busy
| `Shutting_down
| `Starting of float ]
type capacity =
[ `Low_quality of int * bool
| `Normal_quality of int * bool
| `Unavailable ]
type extended_address =
[ `Container of
string * string * string *
[ `Any | `Process of int | `Thread of int ]
| `Socket of Unix.sockaddr
| `Socket_file of string
| `W32_pipe of string
| `W32_pipe_file of string ]
class type controller =
object
method activate_lever :
int -> Netplex_types.encap -> Netplex_types.encap
method add_admin : (Rpc_server.t -> unit) -> unit
method add_message_receiver :
Netplex_types.ctrl_message_receiver -> unit
method add_plugin : Netplex_types.plugin -> unit
method add_service :
Netplex_types.socket_service ->
Netplex_types.workload_manager -> unit
method container_count : string -> int
method containers : Netplex_types.container_id list
method containers_for : string -> Netplex_types.container_id list
method controller_config : Netplex_types.controller_config
method event_system : Unixqueue.unix_event_system
method free_resources : unit -> unit
method logger : Netplex_types.logger
method ptype : Netplex_types.parallelization_type
method register_lever :
(Netplex_types.controller ->
Netplex_types.encap -> Netplex_types.encap) ->
int
method restart : unit -> unit
method send_admin_message : string -> string -> string array -> unit
method send_message : string -> string -> string array -> unit
method services :
(Netplex_types.socket_service * Netplex_types.socket_controller *
Netplex_types.workload_manager)
list
method shutdown : unit -> unit
method startup_directory : string
method sys_id : Netplex_types.thread_sys_id
end
and controller_config =
object
method create_logger : Netplex_types.controller -> Netplex_types.logger
method max_level : Netplex_types.level
method set_max_level : Netplex_types.level -> unit
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 on_add : Netplex_types.controller -> unit
method processor : Netplex_types.processor
method shutdown : unit -> unit
method socket_service_config : Netplex_types.socket_service_config
method sockets : (string * Unix.file_descr array) list
method startup_directory : string
end
and socket_service_config =
object
method change_user_to : (int * int) option
method conn_limit : int option
method controller_config : Netplex_types.controller_config
method gc_when_idle : bool
method name : string
method protocols : Netplex_types.protocol list
method startup_timeout : float
end
and protocol =
object
method addresses : Netplex_types.extended_address array
method configure_slave_socket : Unix.file_descr -> unit
method lstn_backlog : int
method lstn_reuseaddr : bool
method name : string
method so_keepalive : bool
method tcp_nodelay : bool
end
and socket_controller =
object
method container_state :
(Netplex_types.container_id * string *
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 -> int
method state : Netplex_types.socket_state
method stop_containers : Netplex_types.container_id list -> unit
end
and ctrl_message_receiver =
object
method name : string
method receive_admin_message :
Netplex_types.controller -> string -> string array -> unit
method receive_message :
Netplex_types.controller -> string -> string array -> unit
end
and processor_hooks =
object
method container_event_system : unit -> Unixqueue.event_system
method container_run : Unixqueue.event_system -> unit
method global_exception_handler : exn -> bool
method post_add_hook :
Netplex_types.socket_service -> Netplex_types.controller -> 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 -> Netplex_types.controller -> 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
method system_shutdown : unit -> unit
method workload_hook : Netplex_types.container -> bool -> int -> unit
end
and processor =
object
method container_event_system : unit -> Unixqueue.event_system
method container_run : Unixqueue.event_system -> unit
method global_exception_handler : exn -> bool
method post_add_hook :
Netplex_types.socket_service -> Netplex_types.controller -> 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 -> Netplex_types.controller -> 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
method system_shutdown : unit -> unit
method workload_hook : Netplex_types.container -> bool -> int -> unit
end
and container =
object
method activate_lever :
int -> Netplex_types.encap -> Netplex_types.encap
method call_plugin :
Netplex_types.plugin -> string -> Xdr.xdr_value -> Xdr.xdr_value
method container_id : Netplex_types.container_id
method event_system : Unixqueue.unix_event_system
method log : Netplex_types.level -> string -> unit
method log_subch : string -> Netplex_types.level -> string -> unit
method lookup : string -> string -> string option
method lookup_container_sockets : string -> string -> string array
method n_connections : int
method n_total : int
method owned_container_sockets : (string * string) list
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 socket_service_name : string
method start : Unix.file_descr -> Unix.file_descr -> unit
method startup_directory : string
method system : Rpc_client.t
method system_monitor : Uq_mt.monitor
method update_detail : Unix.file_descr -> string -> unit
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
and plugin =
object
method ctrl_added : Netplex_types.controller -> unit
method ctrl_container_finished :
Netplex_types.controller ->
Netplex_types.container_id -> bool -> unit
method ctrl_receive_call :
Netplex_types.controller ->
Netplex_types.container_id ->
string -> Xdr.xdr_value -> (Xdr.xdr_value option -> unit) -> unit
method ctrl_unplugged : Netplex_types.controller -> unit
method program : Rpc_program.t
method required : Netplex_types.plugin list
end
class type par_thread =
object
method info_string : string
method parallelizer : Netplex_types.parallelizer
method ptype : Netplex_types.parallelization_type
method sys_id : Netplex_types.thread_sys_id
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 ->
Unix.file_descr list ->
string -> Netplex_types.logger -> Netplex_types.par_thread
end
type config_tree =
[ `Parameter of string * Netplex_types.param_value
| `Section of 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`