cereal.messaging package

Submodules

cereal.messaging.demo module

cereal.messaging.messaging_pyx module

class cereal.messaging.messaging_pyx.Context

Bases: object

term()
exception cereal.messaging.messaging_pyx.MessagingError

Bases: Exception

exception cereal.messaging.messaging_pyx.MultiplePublishersError

Bases: MessagingError

class cereal.messaging.messaging_pyx.Poller

Bases: object

poll()
registerSocket()
class cereal.messaging.messaging_pyx.PubSocket

Bases: object

all_readers_updated()
connect()
send()
class cereal.messaging.messaging_pyx.SubSocket

Bases: object

connect()
receive()
setTimeout()

cereal.messaging.stress module

Module contents

class cereal.messaging.PubMaster(services: List[str])[source]

Bases: object

all_readers_updated(s: str) bool[source]
send(s: str, dat: Union[bytes, _DynamicStructBuilder]) None[source]
class cereal.messaging.SubMaster(services: List[str], poll: Optional[List[str]] = None, ignore_alive: Optional[List[str]] = None, ignore_avg_freq: Optional[List[str]] = None, addr: str = '127.0.0.1')[source]

Bases: object

all_alive(service_list=None) bool[source]
all_checks(service_list=None) bool[source]
all_freq_ok(service_list=None) bool[source]
all_valid(service_list=None) bool[source]
update(timeout: int = 1000) None[source]
update_msgs(cur_time: float, msgs: List[_DynamicStructReader]) None[source]
cereal.messaging.drain_sock(sock: SubSocket, wait_for_one: bool = False) List[_DynamicStructReader][source]

Receive all message currently available on the queue

cereal.messaging.drain_sock_raw(sock: SubSocket, wait_for_one: bool = False) List[bytes][source]

Receive all message currently available on the queue

cereal.messaging.log_from_bytes(dat: bytes) _DynamicStructReader[source]
cereal.messaging.new_message(service: Optional[str] = None, size: Optional[int] = None) _DynamicStructBuilder[source]
cereal.messaging.pub_sock(endpoint: str) PubSocket[source]
cereal.messaging.recv_one(sock: SubSocket) Optional[_DynamicStructReader][source]
cereal.messaging.recv_one_or_none(sock: SubSocket) Optional[_DynamicStructReader][source]
cereal.messaging.recv_one_retry(sock: SubSocket) _DynamicStructReader[source]

Keep receiving until we get a message

cereal.messaging.recv_sock(sock: SubSocket, wait: bool = False) Optional[_DynamicStructReader][source]

Same as drain sock, but only returns latest message. Consider using conflate instead.

cereal.messaging.sub_sock(endpoint: str, poller: Optional[Poller] = None, addr: str = '127.0.0.1', conflate: bool = False, timeout: Optional[int] = None) SubSocket[source]