module OBus_peer:sig
..end
type
t = {
|
connection : |
(* | Connection used to reach the peer. | *) |
|
name : |
(* | Name of the peer. This only make sense if the connection is a connection to a message bus. | *) |
val compare : t -> t -> int
Pervasives.compare
. It allows this module to be used
as argument to the functors Set.Make
and Map.Make
.val connection : t -> OBus_connection.t
connection
projectionval name : t -> OBus_name.bus
name
projectionBoth possibility have advantages and drawbacks:
OBus_bus
), ensure that the peer won't change over time.
By the way if the service exit, or another application replace it
and we want to always use the default one, we have to write the
code to handle owner change.
Always use bus name for a well-known objects, such as
"/org/freedesktop/Hal/Manager" on "org.freedesktop.Hal.Manager"
and use unique name for objects for which the path is retreived
from a method call.
val make : connection:OBus_connection.t -> name:OBus_name.bus -> t
make connection name
make a named peerval anonymous : OBus_connection.t -> t
anonymous connection
make an anonymous peerval ping : t -> t Lwt.t
For example, the fastest way to get the the peer owning a bus name, and start it if not running is:
ping (OBus_peer.make bus "well.known.name")
val get_machine_id : t -> OBus_uuid.t Lwt.t
val wait_for_exit : t -> unit Lwt.t
wait_for_exit peer
wait until peer
exit. If peer
is not
running then it returns immediatly. Raises Invalid_argument
if
the peer has no name.typepeer =
t
module type Private =sig
..end
module Private:sig
..end