API Reference

protocol

Rembus messages, protocol constants and utility function related to the transport layer.

rembus.protocol.CBOR = 0

CBOR encoding

rembus.protocol.JSON = 1

JSON encoding

class rembus.protocol.RembusMsg

Bases: BaseModel

Rembus message

property twin

Return the Twin that owns the message

to_payload(enc)

Encode the message into a serializable format.

Parameters:

enc (int) –

The encoding format. Supported values:

  • CBOR : return a CBOR-encoded byte string

  • JSON : return a JSON-encoded string

Returns:

The serialized payload. Returns bytes for CBOR encoding and str for JSON encoding.

Return type:

bytes | str

Notes

This is an abstract method and must be implemented in subclasses. It is available in all subclasses of RembusMsg such as RpcReqMsg and ResMsg.

class rembus.protocol.Ack2Msg

Bases: RembusMsg

Ack2 message used for QOS2

id: int
to_payload(enc)

Serialize the Ack2 message.

Parameters:

enc (int)

Return type:

bytes | str

class rembus.protocol.AckMsg

Bases: RembusMsg

Ack message used for Pub/Sub QOS1 and QOS2.

id: int
to_payload(enc)

Serialize the Ack message.

Parameters:

enc (int)

Return type:

bytes | str

class rembus.protocol.AdminMsg

Bases: RembusMsg

Admin message.

id: int
topic: str
data: Any = None
to_payload(enc)

Serialize the Admin message.

Parameters:

enc (int)

Return type:

bytes | str

class rembus.protocol.AttestationMsg

Bases: RembusMsg

Attestation message.

id: int
cid: str
signature: bytes | str
to_payload(enc)

Serialize the Attestation message.

Parameters:

enc (int)

Return type:

bytes | str

class rembus.protocol.IdentityMsg

Bases: RembusMsg

Identity message.

This message is sent by the component to identify itself to the remote peer.

id: int
cid: str
to_payload(enc)

Serialize the Identity message.

Parameters:

enc (int)

Return type:

bytes | str

class rembus.protocol.PubSubMsg

Bases: RembusMsg

Pub/Sub message.

id: int | None = None
topic: str
data: Any = None
flags: int = 0
slot: int | None = None
recvts: int | None = None
table: str | None = None
regex: str | None = None
to_payload(enc)

Serialize the Pub/Sub message.

Parameters:

enc (int)

Return type:

bytes | str

class rembus.protocol.RegisterMsg

Bases: RembusMsg

Register message.

id: int
cid: str
pin: str
pubkey: bytes | str
type: int
to_payload(enc)

Serialize the Register message.

Parameters:

enc (int)

Return type:

bytes | str

class rembus.protocol.ResMsg

Bases: RembusMsg

Response message.

id: int
status: int
data: Any = None
to_payload(enc)

Serialize the Response message.

Parameters:

enc (int)

Return type:

bytes | str

class rembus.protocol.RpcReqMsg

Bases: RembusMsg

RPC request message.

id: int
topic: str
data: Any = None
target: str | None = None
to_payload(enc)

Serialize the RpcRequest message.

Parameters:

enc (int)

Return type:

bytes | str

class rembus.protocol.UnregisterMsg

Bases: RembusMsg

Unregister message.

id: int
to_payload(enc)

Serialize the Unregister message.

Parameters:

enc (int)

Return type:

bytes | str

core

The core module of the Rembus library that includes implementations for the RbURL and Supervised concept.

class rembus.core.FutureResponse

Bases: object

Encapsulate a future response for a Rembus message request.

class rembus.core.RbURL

Bases: object

A class to parse and manage Rembus URLs. It supports the repl scheme, the standard ws/wss and mqtt/mqtts schemes.

The URL repl scheme defines a broker.

isbroker()

Check if the url defines a broker.

Return the remote connection url endpoint.

property twkey

Return a twin unique string identifier.

class rembus.core.Supervised

Bases: object

A superclass that provides task supervision and auto-restarting for a designated task. Subclasses must implement the _task_impl coroutine.

downstream: Supervised | None

The supervised router process next in the chain of Supervised messages handlers.

The downstream direction terminates at the router returned by top_router().

async shutdown()

Gracefully stops the supervised worker and its supervisor.

Return type:

None

async start()

Starts the supervisor task.

Return type:

None

upstream: Supervised | None

The supervised router process previous in the chain of Supervised messages handlers.

The upstream direction terminates at the router returned by bottom_router(). It is the router process directly bound to the Twin entity.

rembus.core.bytes_to_b64(val, enc)

Encode val as Base64 if enc equals rp.JSON.

Returns a UTF-8 string containing the Base64 representation when JSON encoding is requested, otherwise returns val unchanged.

Parameters:
  • val (bytes)

  • enc (int)

rembus.core.domain(s)

Return the domain portion of a string.

If the input string does not contain a domain, the root domain “.” is returned.

Parameters:

s (str)

Return type:

str

rembus.core.randname()

Return a random name for a component.

Return type:

str

rembus.core.response_data(msg)

Return the response data or raise an exception on error.

Parameters:

msg (ResMsg)

twin

The twin module implements the Twin class and the function related to the lifecycle of twins entities.

class rembus.twin.Twin

Bases: Supervised

A Twin represents a Rembus component, either as a client or server. It handles the connection, message sending and receiving, and provides methods for RPC, pub/sub, and other commands interactions.

property db_attach

Return the DuckDB ATTACH directive.

property db

Return the database associated with this twin.

property rid

Return the unique id of the rembus component.

property twkey

Return the twin key

property router

Return the top router associated with this twin.

property domain: str

Return the domain of the twin.

property broker_dir: str

Return the directory of this broker.

property ismqtt

Check if twin speaks MQTT.

isadmin()

Return True if the current object has administrative privileges.

Checks whether the component name is listed among the broker’s administrators.

isbroker()

Return True if this object represents a server or broker handle.

Used to identify objects that act as message brokers within the system.

isopen()

Return True if the twin is currently connected.

Checks the connection state of the underlying socket.

async connect()

Connect to a broker.

async response(status, msg, data=None)

Send a response message to the component managed by this Twin.

Parameters:
  • status (int) – The status code of the response.

  • msg (Any) – The message content or description.

  • data (Any, optional) – Optional additional data to include in the response (default is None).

inject(data)

Inject data into the router’s shared context.

Stores the provided data in the top router’s shared attribute, initializing or updating the shared context for components.

Parameters:

data (Any) – The object to store in the shared context.

register_shutdown()

Register signal handlers to gracefully shut down the component.

On non-Windows platforms, this adds handlers for SIGINT and SIGTERM that schedule the asynchronous close() method. This ensures the component can perform cleanup when the process is interrupted or terminated.

async twin_receiver()

Receive messages from the WebSocket connection.

async future_request(msgid)

Return the asyncio.Future associated with a given message ID.

Parameters:

msgid (int) – The identifier of the message whose future is requested.

Returns:

The Future object corresponding to the message ID.

Return type:

asyncio.Future

async send(msg)

Send a message through the Rembus messaging system.

Parameters:

msg (rembus.protocol.RembusMsg) – The message to send. This must be an subclass instance of RembusMsg (e.g., RpcReqMsg, PubSubMsg, etc.).

send_task(msg)

Send an RPC request and return a future representing its response.

This method schedules send() as an asyncio task and registers the outgoing request so that the corresponding response can be matched using the message identifier.

Parameters:

msg (rembus.protocol.RpcReqMsg) – The RPC request message to send.

Returns:

An awaitable object that resolves when the response for the given message is received.

Return type:

FutureResponse

async wait_response(futreq)

Wait for a response or a Timeout

async login()

Perform the login handshake with the remote peer.

The method first sends an IdentityMsg identifying the component. If the remote peer replies with a challenge, the challenge is signed using the component’s private key and an AttestationMsg is sent to complete the authentication process.

If no challenge is returned, the connection proceeds in free mode (unauthenticated access).

Raises:
  • RembusError – If the authentication exchange fails.

  • RembusTimeout – If the remote peer does not respond within the expected time.

async publish(topic, *data, **kwargs)

Publish a message to a topic.

Parameters:
  • topic (str) – The name of the topic to publish to.

  • *data (Any) – Positional payload values to include in the published message. These are delivered to subscribers as the message content.

  • **kwargs (Any) – Optional keyword arguments controlling publication behavior (e.g., QoS level, slot, or other transport-specific options).

Notes

The message is sent asynchronously and does not wait for delivery acknowledgment unless explicitly configured (e.g., via QoS settings).

async put(topic, *args, **kwargs)

Publish a message to a topic namespaced with the component ID.

This method automatically prefixes the given topic with the component’s name, so that the message is sent to a topic unique to this component.

Parameters:
  • topic (str) – The topic name (without the component prefix) to publish to.

  • *args (Any) – Positional payload values to include in the message.

  • **kwargs (Any) – Optional keyword arguments passed to publish(), such as QoS, slot, or other transport-specific options.

Notes

This is a convenience wrapper around publish() and is useful for sending messages scoped to this component.

async broker_setting(command, args)

Send a broker configuration command and wait for a response.

This method sends an administrative message targeting the broker. The command specifies the action, and args provides any additional parameters required by the specific command.

Parameters:
  • command (str) – The broker command to execute (e.g., “reactive”, “unreactive”).

  • args (dict[str, Any]) – Additional key-value parameters to include with the command.

Returns:

The broker’s response data, decoded from the admin message.

Return type:

Any

Raises:
  • RembusError – If the broker returns an error response.

  • RembusTimeout – If no response is received within the configured timeout.

async setting(topic, command, args=None)

Send a configuration command for a specific topic and await the response.

This method allows sending an administrative or configuration command targeting a particular topic. The command specifies the action to perform, while args can include additional parameters required by the command.

Parameters:
  • topic (str) – The topic to which the configuration command applies.

  • command (str) – The command to execute (e.g., “expose”, “subscribe”).

  • args (dict[str, Any]) – Additional key-value parameters to include with the command.

Returns:

The broker’s response data, decoded from the admin message.

Return type:

Any

Raises:
  • RembusError – If the broker returns an error response.

  • RembusTimeout – If no response is received within the configured timeout.

async rpc(topic, *args)

Send a Remote Procedure Call (RPC) request to a specific topic.

This method constructs and sends an RPC request with the given topic and optional positional arguments. The request expects a response.

Parameters:
  • topic (str) – The name of the RPC method to invoke.

  • *args (Any) – Optional positional arguments to include in the RPC request.

Returns:

A future-like object representing the pending RPC response.

Return type:

FutureResponse

Raises:
  • RembusError – If the RPC call results in an error response.

  • RembusTimeout – If no response is received within the configured timeout.

async direct(target, topic, *args)

Send a direct RPC request to a specific target component.

This method sends a Remote Procedure Call (RPC) to a single component identified by target. The topic specifies the RPC method or event, and optional positional arguments are passed as parameters to the request.

Parameters:
  • target (str) – The component name of the node receiving the RPC.

  • topic (str) – The RPC method to invoke on the target.

  • *args (Any) – Optional positional arguments to include in the RPC request.

Returns:

A future-like object representing the pending response from the target.

Return type:

FutureResponse

Raises:
  • RembusError – If the target returns an error response.

  • RembusTimeout – If no response is received within the configured timeout.

async register(rid, pin, scheme=1)

Provision a new component with the specified identifier.

This method registers a component in the Rembus system by associating it with a unique component name (rid) and a secret (pin) for authentication. A cryptographic key pair is generated according to the specified scheme and the public key is sent to the broker for registration.

Parameters:
  • rid (str) – The unique identifier for the component to register.

  • pin (str) – A PIN code used for component authentication.

  • scheme (int, optional) – The cryptographic signature scheme to use for key generation. Supported values are: - rp.SIG_RSA (default) - rp.SIG_ECDSA

Return type:

None

Raises:
  • RembusError – If the broker rejects the registration.

  • RembusTimeout – If no response is received within the configured timeout.

async unregister()

Unregister and unprovision the current component.

This method removes the component’s registration from the Rembus broker and deletes any associated public key. After calling this method, the component loses its provisioned privileges; other components may then connect using the same identifier.

Return type:

None

Raises:
  • RembusError – If the broker rejects the unregistration request.

  • RembusTimeout – If no response is received within the configured timeout.

async reactive()

Enable reactive mode for the component.

In reactive mode, the component receives messages published on topics it has subscribed to.

Return type:

None

Raises:
  • RembusError – If the broker rejects the reactive request.

  • RembusTimeout – If no response is received within the configured timeout.

async unreactive()

Disable reactive mode for the component.

In unreactive mode, the component stops receiving messages published on topics it has subscribed to. This effectively pauses automatic message delivery, though the component can still publish messages or query the broker directly.

Return type:

None

Raises:
  • RembusError – If the broker rejects the unreactive request.

  • RembusTimeout – If no response is received within the configured timeout.

async private_topic(topic)

Mark a topic as private.

This sets the specified topic to private, restricting access so that only authorized components can publish or subscribe to it. The component must have administrative privileges to change the privacy level of a topic.

Parameters:

topic (str) – The name of the topic to set as private.

Return type:

None

Raises:
  • RembusError – If the broker rejects the request or the component lacks privileges.

  • RembusTimeout – If no response is received within the configured timeout.

async public_topic(topic)

Mark a topic as public.

This sets the specified topic to public, allowing any component to publish or subscribe to it. The component must have administrative privileges to change the privacy level of a topic.

Parameters:

topic (str) – The name of the topic to set as public.

Return type:

None

Raises:
  • RembusError – If the broker rejects the request or the component lacks privileges.

  • RembusTimeout – If no response is received within the configured timeout.

async authorize(component, topic)

Grant a component access to a private topic.

This method authorizes the specified component to publish or subscribe to the private topic. The calling component must have administrative privileges to grant access.

Parameters:
  • component (str) – The identifier of the component to authorize.

  • topic (str) – The name of the private topic for which access is granted.

Return type:

None

Raises:
  • RembusError – If the broker rejects the authorization or the caller lacks privileges.

  • RembusTimeout – If no response is received within the configured timeout.

async unauthorize(component, topic)

Revoke a component’s access to a private topic.

This method removes the specified component’s permission to publish or subscribe to the private topic. The calling component must have administrative privileges to revoke access.

Parameters:
  • component (str) – The identifier of the component whose access is being revoked.

  • topic (str) – The name of the private topic from which access is removed.

Return type:

None

Raises:
  • RembusError – If the broker rejects the revocation or the caller lacks privileges.

  • RembusTimeout – If no response is received within the configured timeout.

async subscribe(fn, msgfrom=0.0, topic=None)

Subscribe a callback function to a topic to receive published messages.

The callback fn will be invoked for each message published to the specified topic. Messages published before the subscription can optionally be ignored using the msgfrom parameter.

Parameters:
  • fn (Callable[..., Any]) – The function to be called for each received message. The function should accept a single argument containing the message payload.

  • msgfrom (float, optional) – A timestamp in nanoseconds specifying the earliest message to deliver upon subscription. The default rp.Now starts from the moment of subscription, ignoring previously published messages.

  • topic (str, optional) – The topic to subscribe to. If None, the callback function’s name (fn.__name__) is used as the topic identifier.

Return type:

None

Raises:
  • RembusError – If the subscription request is rejected by the broker or fails due to an internal error.

  • RembusTimeout – If no response is received within the configured timeout.

async unsubscribe(fn)

Unsubscribe a callback function or topic name from receiving messages.

This removes a previously registered subscription. If a function is given, it will be unsubscribed from the topic it was originally subscribed to. If a topic name (string) is provided, all callbacks subscribed to that topic will be removed.

Parameters:

fn (Callable[..., Any] or str) – The callback function to remove from its topic subscription, or the topic name to remove all subscriptions for.

Return type:

None

Raises:
  • RembusError – If the unsubscription fails due to a broker error or internal failure.

  • RembusTimeout – If the broker does not respond within the configured timeout.

async expose(fn, topic=None)

Expose a function as a remote procedure call (RPC) handler.

Once exposed, the function can be called remotely by other components through the Rembus messaging system. The topic identifies the RPC endpoint. If topic is not provided, the function’s name (fn.__name__) is used as the topic name.

Parameters:
  • fn (Callable[..., Any]) – The function to expose as an RPC handler. The function should accept arguments corresponding to the RPC request parameters.

  • topic (str, optional) – The RPC topic name under which the function is exposed. Defaults to the function’s name if not specified.

Return type:

None

Raises:
  • RembusError – If exposing the function fails due to an internal error.

  • RembusTimeout – If the broker does not acknowledge the RPC exposure within the configured timeout.

async unexpose(fn, topic=None)

Remove a previously exposed function from being a remote procedure call (RPC) handler.

After calling this method, the function will no longer be callable remotely through the Rembus messaging system. The topic identifies the RPC endpoint; if not provided, the function’s name (fn.__name__) is used.

Parameters:
  • fn (Callable[..., Any] | str) – The function or function name to unexpose as an RPC handler.

  • topic (str, optional) – The RPC topic name under which the function was previously exposed. Defaults to the function’s name if not specified.

Return type:

None

Raises:
  • RembusError – If unexposing the function fails due to an internal error.

  • RembusTimeout – If the broker does not acknowledge the RPC removal within the configured timeout.

async close()

Close the connection to the Rembus broker and clean up associated resources.

After calling this method, the component will no longer send or receive messages until it reconnects. All pending subscriptions and RPC handlers will remain registered on the broker, but the local connection state is reset.

Return type:

None

Raises:

RembusError – If an error occurs while closing the connection.

async wait(timeout=None, signal_handler=True)

Start the event loop to process incoming Rembus messages.

This method runs the twin’s main loop, receiving and dispatching messages to the appropriate subscriptions and RPC handlers. The loop continues until the connection is closed or an optional timeout expires.

Parameters:
  • timeout (float | None, optional) – Maximum time in seconds to wait before stopping the loop. If None (default), the loop runs indefinitely until manually stopped.

  • signal_handler (bool, optional) – Whether to enable handling of OS signals (e.g., SIGINT) to gracefully terminate the loop. Defaults to True.

Return type:

None

Raises:
  • RembusError – If an internal error occurs while processing messages.

  • RembusTimeout – If the loop times out while waiting for messages (only if timeout is set).

class rembus.twin.MqttTwin

Bases: Twin

An MqttTwin represents a Rembus component communicating over MQTT.

This class wraps a Twin with MQTT transport, allowing the component to act as a publisher or subscriber connected to a MQTT broker.

Inherits all attributes and methods from :class:`Twin`.
isbroker()

Always False for the MqttTwin subclass.

Return type:

bool

async on_message(client, topic, payload, qos, properties)

Handle incoming MQTT messages and route them to the router’s inbox.

This method is called automatically by the MQTT client whenever a message is received on a subscribed topic. It forwards the message payload to the appropriate router for processing.

async connect()

Establish a connection to the configured MQTT broker.

This method connects the MQTT client to the broker endpoint specified in the Twin configuration. After calling this, the Twin can publish and subscribe to topics over MQTT.

async send(msg)

Send a Rembus message over MQTT.

Only Pub/Sub messages (rp.PubSubMsg) are supported on the MQTT transport. Attempting to send other message types will raise a TypeError.

Parameters:

msg (rp.RembusMsg) – The Rembus message to send. Must be an instance of rp.PubSubMsg.

Raises:

TypeError – If msg is not an instance of rp.PubSubMsg.

isopen()

Check whether the MQTT connection is currently open.

Returns:

True if the connection to the MQTT broker is active, False otherwise.

Return type:

bool

class rembus.twin.ReplTwin

Bases: Twin

A ReplTwin represents a virtual Rembus component that acts as a broker.

Unlike a standard Twin, which connects a component to a Rembus broker, a ReplTwin simulates a broker itself.

Inherits all attributes and methods from :class:`Twin`.
isbroker()

Check if twin is a REPL

Return type:

bool

isopen()

Check if the connection is open.

Return type:

bool

async send(msg)

No-op send for REPL twin.

Parameters:

msg (RembusMsg)

class rembus.twin.WsTwin

Bases: Twin

A WsTwin represents a Rembus component communicating over WebSocket.

This class wraps a Twin with WebSocket transport.

Inherits all attributes and methods from :class:`Twin`.
isbroker()

Check whether this Twin represents a broker.

Returns:

Always False for WsTwin, as it represents a connected component, not a broker.

Return type:

bool

isopen()

Check if the WebSocket connection is currently open.

Returns:

True if the WebSocket connection is open; False if the socket is not connected or has not been initialized.

Return type:

bool

async connect()

Establish a WebSocket connection to the Rembus broker.

This method handles SSL if the URL scheme is wss, sets up the receiver task, and performs login if the Twin has a registered name.

Raises:

RembusError – If login fails after connecting to the broker.

async send(msg)

Send a Rembus message over the WebSocket connection.

Parameters:

msg (rp.RembusMsg)

Notes

Any exceptions during sending are logged as errors but not raised.

rembus.twin.exposed_topics_for_twin(router, twin)

Get list of topics exposed by this twin.

Return type:

List[str]

async rembus.twin.init_twin(router, uid, enc, isserver)

Create and initialize a Twin instance for the component identified by uid.

This function sets up the messaging Twin for the specified component, handling all necessary initialization.

Parameters:
  • router (Router) – The Rembus router to connect or interact with.

  • uid (RbURL) – The unique identifier of the component.

  • enc (int) – The message encoding type (e.g., rp.CBOR or rp.JSON).

  • isserver (bool) – Indicates whether the Twin should operate as a server (broker) or as a client (connected component).

Returns:

The initialized Twin instance. If isserver is True, a ReplTwin representing the broker is returned instead of a connected client Twin.

Return type:

Twin

Notes

A ReplTwin is a special Twin that represents a broker itself, rather than a connected client component.

rembus.twin.save_twin(twin)

Save twin data (subscribers, exposers, and marks) to the database.

router

Router dispatch messages between twins.

class rembus.router.Router

Bases: Supervised

The core Router routes messages between components, each represented by a Twin instance.

append_message(msg)

Append a message to the message cache.

Parameters:

msg (PubSubMsg)

async evaluate(twin, topic, data)

Invoke the handler associate with the message topic.

Parameters:
  • topic (str)

  • data (Any)

Return type:

Any

isauthorized(topic, twin)

Check if the component is authorized. If the topic is public the component is always authorized.

Parameters:

topic (str)

isconnected(rid)

Check if a component with the given rid is connected.

Parameters:

rid (str)

Return type:

bool

async send_message(msg)

Send message to remote node using a twin from the pool of twins

async serve_ws(port, issecure=False)

Start a WebSocket server to handle incoming connections.

Parameters:
  • port (int)

  • issecure (bool)

property twins

Return the twins connected to.

uptime()

Return the uptime of the router.

Return type:

str

rembus.router.bottom_router(router)

Return the router attached to the twin (the lowest router in the chain).

Parameters:

router (Supervised)

Return type:

Supervised

rembus.router.top_router(router)

Return the topmost router (the core router).

Parameters:

router (Supervised)

Return type:

Router

sync

Synchronous APIs.

class rembus.sync.node

Bases: object

The synchronous Rembus twin.

__init__(url=None, name=None, port=None, secure=False, policy='first_up', schema=None, enc=0, keyspace=True, mqtt=None)
Parameters:
  • url (RbURL | str | List[str] | None)

  • name (str | None)

  • port (int | None)

  • secure (bool)

  • policy (str)

  • schema (str | None)

  • enc (int)

  • keyspace (bool)

  • mqtt (str | None)

authorize(component, topic)

Authorize the component to private topic.

self must have the admin role for granting topic accessibility.

Parameters:
  • component (str)

  • topic (str)

close()

Close the connection and clean up resources.

property db_attach

Return the DuckDB ATTACH directive.

direct(target, topic, *args)

Send a direct RPC request to the target component.

Parameters:
  • target (str)

  • topic (str)

  • args (Any)

exec(fn, *args, **kwargs)

Execute a method in the event loop and return its result.

expose(fn, topic=None)

Expose the function as a remote procedure call(RPC) handler.

Parameters:
  • fn (Callable[[...], Any])

  • topic (str | None)

inject(ctx)

Initialize the context object.

Parameters:

ctx (Any)

isbroker()

Check if the node is a broker.

Return type:

bool

isopen()

Check if the connection is open.

Return type:

bool

private_topic(topic)

Set the specified topic to private.

The component must have the admin role to change the privacy level.

Parameters:

topic (str)

public_topic(topic)

Set the specified topic to public.

The component must have the admin role to change the privacy level.

Parameters:

topic (str)

publish(topic, *args, **kwargs)

Publish a message to the specified topic.

Parameters:
  • topic (str)

  • args (Any)

put(topic, *args, **kwargs)

Publish a message to the specified topic.

Parameters:
  • topic (str)

  • args (Any)

reactive()

Set the component to receive published messages on subscribed topics.

register(rid, pin, scheme=1)

Register a component with the given rid.

Parameters:
  • rid (str)

  • pin (str)

  • scheme (int)

register_shutdown()

Register shutdown handler.

property rid

The unique Rembus id for this node.

property router

The router object associated with this node.

rpc(topic, *args)

Send a RPC request.

Parameters:
  • topic (str)

  • args (Any)

subscribe(fn, msgfrom=0.0, topic=None)

Subscribe the function to the corresponding topic.

Parameters:
  • fn (Callable[[...], Any])

  • msgfrom (float)

  • topic (str | None)

property uid

The RbUrl object for this node.

unauthorize(component, topic)

Unauthorize the component to private topic.

self must have the admin role for removing topic accessibility.

Parameters:
  • component (str)

  • topic (str)

unexpose(fn)

Unexpose the function as a remote procedure call(RPC) handler.

Parameters:

fn (Callable[[...], Any] | str)

unreactive()

Set the component to stop receiving published messages on subscribed topics.

unregister()

Unregister the component.

unsubscribe(fn)

Unsubscribe the function from the corresponding topic.

Parameters:

fn (Callable[[...], Any] | str)

wait(timeout=None, signal_handler=True)

Start the twin event loop that wait for rembus messages.

Parameters:
  • timeout (float | None)

  • signal_handler (bool)