platypush.backend.dbus

class platypush.backend.dbus.DBusService(*args: Any, **kwargs: Any)[source]
Post(msg: dict)

This method accepts a message as a dictionary (either representing a valid request or an event) and either executes it (request) or forwards it to the application bus (event).

Parameters

msg – Request or event, as a dictionary.

Returns

The return value of the request, or 0 if the message is an event.

class platypush.backend.dbus.DbusBackend(bus_name='org.platypush.Bus', service_path='/MessageService', *args, **kwargs)[source]

This backend acts as a proxy that receives messages (requests or events) on the DBus and forwards them to the application bus.

The name of the messaging interface exposed by Platypush is org.platypush.MessageBusInterface and it exposes Post method, which accepts a dictionary representing a valid Platypush message (either a request or an event) and either executes it or forwards it to the application bus.

Requires:

  • dbus-python (pip install dbus-python)

__init__(bus_name='org.platypush.Bus', service_path='/MessageService', *args, **kwargs)[source]
Parameters
  • bus_name – Name of the bus where the application will listen for incoming messages (default: org.platypush.Bus).

  • service_path – Path to the service exposed by the app (default: /MessageService).

run()[source]

Starts the backend thread. To be implemented in the derived classes if the loop method isn’t defined.