package async
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=74f2b7b01ce3b92289cc7a68cd3ae53885c763cedd320d27949d585e5c13dc64
md5=9f80cfb72e3defcc9fca50f67e23e93c
doc/async.persistent_connection/Persistent_connection/Versioned_rpc/index.html
Module Persistent_connection.Versioned_rpc
include Persistent_connection_kernel.S
with type address = Core.Host_and_port.t
with type conn = Async.Versioned_rpc.Connection_with_menu.t
The address of a service to which one can connect. E.g. Host_and_port.t
is a reasonable choice when making a TCP connection.
A connection, perhaps embellished with additional information upon connection.
module Event : sig ... end
val connected : t -> conn Async_kernel.Deferred.t
connected
returns the first available connection from the time it is called. When currently connected, the returned deferred is already determined. If closed
has been called, then the returned deferred is never determined.
val connected_or_failed_to_connect :
t ->
conn Core_kernel.Or_error.t Async_kernel.Deferred.t
connected_or_failed_to_connect
is immediately determined as Ok _
if t
is already connected. Otherwise it becomes determined the next time t
becomes connected or fails to connect or when t
is closed.
close t
closes the current connection and stops it from trying to reconnect. After the deferred it returns becomes determined, the last connection has been closed and no others will be attempted.
Note: no close
calls are ever generated internally in response to the connection being closed by the other side.
val close : t -> unit Async_kernel.Deferred.t
close t
closes the connection. The returned deferred becomes determined once any resources needed to maintain the connection have been released.
val is_closed : t -> bool
is_closed t
returns true if close
has ever been called (even if the returned deferred has not yet been fulfilled).
Note that some modules implementing Closable
may call close internally upon noticing that the connection was closed by the other side. The interface of such a module ought to say that this is the case.
val close_finished : t -> unit Async_kernel.Deferred.t
close_finished t
becomes determined at the same time as the result of the first call to close
. close_finished
differs from close
in that it does not have the side effect of initiating a close.
val create :
server_name:string ->
?log:Async.Log.t ->
?on_event:(Event.t -> unit Async.Deferred.t) ->
?retry_delay:(unit -> Core.Time.Span.t) ->
?random_state:Core.Random.State.t ->
?time_source:Async.Time_source.t ->
connect:(address -> conn Core.Or_error.t Async.Deferred.t) ->
(unit -> address Core.Or_error.t Async.Deferred.t) ->
t
val create' :
server_name:string ->
?log:Async.Log.t ->
?on_event:(Event.t -> unit Async.Deferred.t) ->
?retry_delay:(unit -> Core.Time.Span.t) ->
?bind_to_address:Async.Unix.Inet_addr.t ->
?implementations:_ Async.Rpc.Connection.Client_implementations.t ->
?max_message_size:int ->
?make_transport:Async.Rpc.Connection.transport_maker ->
?handshake_timeout:Core.Time.Span.t ->
?heartbeat_config:Async.Rpc.Connection.Heartbeat_config.t ->
(unit -> Core.Host_and_port.t Core.Or_error.t Async.Deferred.t) ->
t
Like create
but for Rpc-like connections (i.e. Async.Rpc and Async.Versioned_rpc) where there is an obvious default for connect
-- with a handful of extra optional parameters to pass to the Rpc.Connection
functions.