- data Client
- clientName :: Client -> BusName
- mkClient :: (Connection, BusName) -> IO Client
- call :: Client -> MethodCall -> (Error -> IO ()) -> (MethodReturn -> IO ()) -> IO ()
- callBlocking :: Client -> MethodCall -> IO (Either Error MethodReturn)
- callBlocking_ :: Client -> MethodCall -> IO MethodReturn
- emitSignal :: Client -> Signal -> IO ()
- requestName :: Client -> BusName -> [RequestNameFlag] -> IO RequestNameReply
- releaseName :: Client -> BusName -> IO ReleaseNameReply
- onSignal :: Client -> MatchRule -> (BusName -> Signal -> IO ()) -> IO ()
- data RemoteObject = RemoteObject BusName ObjectPath
- data Proxy = Proxy RemoteObject InterfaceName
- callProxy :: Client -> Proxy -> MemberName -> [Flag] -> [Variant] -> (Error -> IO ()) -> (MethodReturn -> IO ()) -> IO ()
- callProxyBlocking :: Client -> Proxy -> MemberName -> [Flag] -> [Variant] -> IO (Either Error MethodReturn)
- callProxyBlocking_ :: Client -> Proxy -> MemberName -> [Flag] -> [Variant] -> IO MethodReturn
- onSignalFrom :: Client -> Proxy -> MemberName -> (Signal -> IO ()) -> IO ()
- newtype LocalObject = LocalObject (Map InterfaceName Interface)
- newtype Interface = Interface (Map MemberName Member)
- data Member
- export :: Client -> ObjectPath -> LocalObject -> IO ()
- data MethodCall = MethodCall {}
- replyReturn :: MethodCall -> [Variant] -> IO ()
- replyError :: MethodCall -> ErrorName -> [Variant] -> IO ()
Clients
clientName :: Client -> BusNameSource
mkClient :: (Connection, BusName) -> IO ClientSource
Create a new Client
from an open connection and bus name. The weird
Sending messages
call :: Client -> MethodCall -> (Error -> IO ()) -> (MethodReturn -> IO ()) -> IO ()Source
Perform an asynchronous method call. One of the provided computations will be performed depending on what message type the destination sends back.
callBlocking :: Client -> MethodCall -> IO (Either Error MethodReturn)Source
callBlocking_ :: Client -> MethodCall -> IO MethodReturnSource
Similar to callBlocking
, except that an exception is raised if the
destination sends back an error.
Emitting signals
Name reservation
requestName :: Client -> BusName -> [RequestNameFlag] -> IO RequestNameReplySource
A client can request a "well-known" name from the bus. This allows messages sent to that name to be received by the client, without senders being aware of which application is actually handling requests.
A name may be requested for any client, using the given flags. The bus's reply will be returned, or an exception raised if the reply was invalid.
releaseName :: Client -> BusName -> IO ReleaseNameReplySource
Clients may also release names they've requested.
Receiving signals
onSignal :: Client -> MatchRule -> (BusName -> Signal -> IO ()) -> IO ()Source
Perform some computation every time this client receives a matching signal.
Remote objects and proxies
callProxy :: Client -> Proxy -> MemberName -> [Flag] -> [Variant] -> (Error -> IO ()) -> (MethodReturn -> IO ()) -> IO ()Source
As call
, except that the proxy's information is used to
build the message.
callProxyBlocking :: Client -> Proxy -> MemberName -> [Flag] -> [Variant] -> IO (Either Error MethodReturn)Source
As callBlocking
, except that the proxy's information is used
to build the message.
callProxyBlocking_ :: Client -> Proxy -> MemberName -> [Flag] -> [Variant] -> IO MethodReturnSource
As callBlocking_
, except that the proxy's information is used
to build the message.
onSignalFrom :: Client -> Proxy -> MemberName -> (Signal -> IO ()) -> IO ()Source
Exporting local objects
newtype LocalObject Source
export :: Client -> ObjectPath -> LocalObject -> IO ()Source
Export a set of interfaces on the bus. Whenever a method call is received which matches the object's path, interface, and member name, one of its members will be called.
Exported objects automatically implement the
org.freedesktop.DBus.Introspectable
interface.
Responding to method calls
data MethodCall Source
replyReturn :: MethodCall -> [Variant] -> IO ()Source
Send a successful return reply for a method call.
replyError :: MethodCall -> ErrorName -> [Variant] -> IO ()Source
Send an error reply for a method call.