package async_rpc_kernel
Module Rpc.ImplementationsSource
A 'connection_state Implementations.t is something that knows how to respond to many different queries. It is conceptually a package of 'connection_state Implementation.ts.
Source
type 'connection_state on_unknown_rpc = [ | `Raise| `Continue| `Close_connection(*used to be the behavior of
*)`Ignore| `Call of 'connection_state -> rpc_tag:string -> version:int -> [ `Close_connection | `Continue ](*
*)rpc_tagandversionare the name and version of the unknown rpc
]Source
val create :
implementations:'connection_state Implementation.t list ->
on_unknown_rpc:'connection_state on_unknown_rpc ->
('connection_state t, [ `Duplicate_implementations of Description.t list ])
Core.Result.tcreate ~implementations ~on_unknown_rpc creates a server capable of responding to the rpcs implemented in the implementation list. Be careful about setting on_unknown_rpc to `Raise because other programs may mistakenly connect to this one causing it to crash.
Source
val create_exn :
implementations:'connection_state Implementation.t list ->
on_unknown_rpc:
[ `Raise
| `Continue
| `Close_connection
| `Call of
'connection_state ->
rpc_tag:string ->
version:int ->
[ `Close_connection | `Continue ] ] ->
'connection_state tSource
val add :
'connection_state t ->
'connection_state Implementation.t ->
'connection_state t Core.Or_error.tSource
val add_exn :
'connection_state t ->
'connection_state Implementation.t ->
'connection_state t