module Hydro_netplex:Netplex support for Hydro servers (TCP only)sig
..end
val hydro_factory : configure:(Netplex_types.config_file -> Netplex_types.address -> 'a) ->
?hooks:('a -> Netplex_types.processor_hooks) ->
?supported_ptypes:Netplex_types.parallelization_type list ->
name:string ->
sys:Hydro_types.system ->
setup:(Netplex_types.container -> Hydro_endpoint.Server.t -> 'a -> unit) ->
unit -> Netplex_types.processor_factory
name
the name of the processor
is defined. This name can be referenced from the config file like:
processor {
type = "the passed [name]";
...
}
Currently, there are no parameters in the config file.
Parameters and subsections can be defined by the user, however. These
parameters should be parsed and checked for correctness by the
configure
callback. The result of configure
is also passed
to setup
and other optional functions. The configure
function is
called just before the service is
added to Netplex (i.e. from the controller context).
The return value of configure
can be of any type. This value
exists once for every time the processor is instantiated (used) by a
service. It is not only useful for passing configuration values
down, but also for storing intermediate results while establishing
the service.
The Hydro_endpoint.Server.t
structure is created every time a new connection
is accepted. Of course, this is done from the context of the container.
This structure is created without any binding; the user must
bind procedures in the setup
function. This can be done by calling
Hydro_endpoint.Server.bind_adapter
.
hooks
: An optional function returning the hooks to call.
See Netplex_types.processor_hooks
for documentation.supported_ptypes
: Which parallelization types are supported
by the service. By default, only multi-processing
is included in this list (Hydro still lacks multi-threading support).