IMessageQueueFactory

class carb.eventdispatcher.IMessageQueueFactory

Bases: pybind11_object

Methods

__init__(*args, **kwargs)

create_message_queue(self, name, **kwargs)

Creates a message queue with the given name and parameters, or returns an existing message queue with the given name.

get_message_queue(self, name)

Retrieves a message queue with the given name.

__init__(*args, **kwargs)
create_message_queue(self: carb.eventdispatcher._eventdispatcher.IMessageQueueFactory, name: str, **kwargs) Tuple[carb.eventdispatcher._eventdispatcher.IMessageQueue, bool]

Creates a message queue with the given name and parameters, or returns an existing message queue with the given name.

Parameters

name – (str) The unique name of the message queue. If the name already exists, the message queue will not be created but the previously-created message queue will be returned (params will be ignored). Since names must be unique, a scheme such as reverse-DNS is recommended.

Keyword Arguments

owning_thread – (int, default: 0) The thread that owns the message queue. If zero, the message queue can be popped by multiple threads. If a specific thread owns the message queue then an error will occur if any other thread attempts to pop the message queue, and the message queue will be optimized for the owning thread. Message queues that are created from a task (carb::tasking::ITasking) or thread pool should use zero here instead of using the calling thread. NOTE: This value should be via threading.get_native_id(), NOT threading.get_ident().

Returns

Tuple of (IMessageQueue, bool) where the IMessageQueue is the message queue and the bool is whether it was created by this call (True), or an existing message queue was found and returned (False).

Raises
  • MemoryError – failed to allocate the message queue

  • RuntimeError – an invalid argument was passed

get_message_queue(self: carb.eventdispatcher._eventdispatcher.IMessageQueueFactory, name: str) carb.eventdispatcher._eventdispatcher.IMessageQueue

Retrieves a message queue with the given name.

Parameters

name – (str) The unique name of a previously-created message queue.

Returns

A message queue found by name.