package obus
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=75703f78015e15d03d0fdba1633a155875daf17d854225658429e72a0df06258
md5=3090a796f0af95e16838d81656ac4b97
doc/obus/OBus_signal/index.html
Module OBus_signal
Source
D-Bus signals
Emitting signals
val emit :
'a OBus_member.Signal.t ->
'b OBus_object.t ->
?peer:OBus_peer.t ->
'a ->
unit Lwt.t
emit signal obj ?peer args
emits signal
from obj
. The destinations of the signal are selected as follow:
- if
peer
is provided, then the message is sent only to it - otherwise, if the the object has an owner, it is sent to the owner,
- otherwise, the message is broadcasted on all the connections
obj
is exported on.
Receving signals
Type of a signal descriptor. A signal descriptor represent the source of a signal and describes how the value should be transformed.
make signal proxy
creates a signal descriptor.
make_any signal peer
creates a signal descriptor for receiving signals from any object of peer
.
connect ?switch sd
connects the signal descriptor sd
and returns the event which occurs when the given D-Bus signal is received.
Signals transformations and parameters
val map_event :
((OBus_context.t * 'a) React.event -> (OBus_context.t * 'b) React.event) ->
'a t ->
'b t
map_event f sd
transforms with f
the event that is created when sd
is connected.
Same as map
but the mapping function also receive the context.
with_filters filters sd
is the signal descriptor sd
with the given list of argument filters. When connected, obus will add this filters to the matching rule send to the message bus, so the bus can use them to drop messages that do not match these filters.
The goal of argument filters is to reduce the number of messages received, and so to reduce the number of wakeup of the program.
Note that match rule management must be activated for filters to take effect (see with_match_rule
).