rosbridge_library.internal.subscription_modifiers module

class rosbridge_library.internal.subscription_modifiers.MessageHandler(previous_handler: MessageHandler | None = None, publish: Callable[[MsgT], None] | None = None)

Bases: Generic[MsgT]

finish(block: bool = True) None
handle_message(msg: MsgT) None
last_publish: float
publish: Callable[[MsgT], None] | None
queue_length: int
set_queue_length(queue_length: int) MessageHandler
set_throttle_rate(throttle_rate: float) MessageHandler
throttle_rate: float
time_remaining() float
transition() MessageHandler
class rosbridge_library.internal.subscription_modifiers.QueueMessageHandler(previous_handler: MessageHandler)

Bases: MessageHandler[MsgT], Thread

finish(block: bool = True) None

Notify the thread to finish, and optionally wait for it to finish.

If throttle was set to 0, this pushes all buffered messages.

Parameters:

block – If True, wait for the thread to finish before returning

handle_message(msg: MsgT) None
run() None

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

transition() MessageHandler
class rosbridge_library.internal.subscription_modifiers.ThrottleMessageHandler(previous_handler: MessageHandler | None = None, publish: Callable[[MsgT], None] | None = None)

Bases: MessageHandler[MsgT]

finish(block: bool = True) None
handle_message(msg: MsgT) None
transition() MessageHandler