wotpy.protocols.zenoh.server

Class that implements the Zenoh server (router).

Classes

ZenohServer(router_url[, ...])

Zenoh binding server implementation.

class wotpy.protocols.zenoh.server.ZenohServer(router_url, property_callback_ms=None, event_callback_ms=None, servient_id=None)

Bases: BaseProtocolServer

Zenoh binding server implementation.

DEFAULT_SERVIENT_ID = 'wotpy'
build_base_url(hostname, thing)

Returns the base URL for the given Thing in the context of this server.

build_forms(hostname, interaction)

Builds and returns a list with all Forms that are linked to this server for the given Interaction.

async connect(force_reconnect=False)

Connects to the Zenoh broker.

async disconnect()

Disconnects from the Zenoh broker.

property protocol

Protocol of this server instance. A member of the Protocols enum.

property scheme

Returns the URL scheme for this server.

property servient_id

Servient ID that is used to avoid topic collisions when multiple Servients are connected to the same broker.

async start(servient=None)

Starts the Zenoh broker and all the Zenoh clients that handle the WoT clients requests.

async stop()

Stops the Zenoh broker and the Zenoh clients.