Octogram.Remote_procedure
type ('a, 'uri) remote_procedure = ('a, 'uri) t
module type S = sig ... end
The module type to implement in order to be able to make agents capable of executing a new kind of remote procedure
val packed_encoding : 'uri Data_encoding.t -> 'uri packed Data_encoding.t
val encode_response : ('a, 'uri) t -> 'a -> string
val response_encoding : ('a, 'uri) t -> 'a Data_encoding.t
val merged_encoding :
'a Data_encoding.t ->
'uri Data_encoding.t ->
('a * 'uri packed) Data_encoding.t
val tvalue_of_response : ('a, 'uri) t -> 'a -> Jingoo.Jg_types.tvalue
val expand :
self:Agent_name.t ->
vars:Global_variables.t ->
agent:Jingoo.Jg_types.tvalue ->
re:Jingoo.Jg_types.tvalue ->
item:Jingoo.Jg_types.tvalue ->
string packed ->
Uri.global_uri packed
val resolve_global_uris :
self:Agent_name.t ->
Uri_resolver.t ->
Uri.global_uri packed ->
Uri.agent_uri packed
val run : Agent_state.t -> ('a, Uri.agent_uri) t -> 'a Lwt.t
val on_completion :
on_new_service:
(string ->
Services_cache.node_kind ->
Services_cache.service_kind ->
int ->
unit) ->
on_new_metrics_source:(string -> Services_cache.node_kind -> int -> unit) ->
('a, 'uri) t ->
'a ->
unit
val register : (module S) -> unit
register (module P)
plugs the remote procedure specified in P
into Octogram machinery.
module P = struct let name = _ type 'uri t = _ type r = _ let of_remote_procedure : type a. (a, 'uri) Remote_procedure.t -> 'uri t option = function | _ _ args -> Some args | _ -> None let to_remote_procedure args = _ args let unify : type a. (a, 'uri) Remote_procedure.t -> (a, r) Remote_procedure.eq = function | _ -> Eq | _ -> Neq let encoding uri_encoding = _ let r_encoding = _ let tvalue_of_r args = _ let expand ~self ~run args = _ let resolve ~self resolver args = _ let run state args = _ let on_completion ~on_new_service ~on_new_metrics_source args = _ end
val file_agent_uri :
self:Agent_name.t ->
resolver:Uri_resolver.t ->
Uri.global_uri ->
Uri.agent_uri
val global_uri_of_string :
self:Agent_name.t ->
run:(string -> string) ->
string ->
Uri.global_uri