Crate busrt

Source
Expand description

BUS/RT - Rust-native IPC broker crates.io page docs.rs page GitHub Actions CI

§What is BUS/RT

BUS/RT® is a Rust-native IPC broker, written in Rust/Tokio, inspired by NATS, ZeroMQ and Nanomsg. BUS/RT is fast, flexible and very easy to use, optimized for both high-load and ultra-low latency real-time scenarios.

The library can be embedded in any Rust project or be used as a standalone server.

BUS/RT is the core bus of EVA ICS v4.

§Inter-process communication

The following communication patterns are supported out-of-the-box:

  • one-to-one messages
  • one-to-many messages
  • pub/sub

The following channels are supported:

  • async channels between threads/futures (Rust only)
  • UNIX sockets (local machine, Linux/BSD)
  • TCP sockets (Linux/BSD/Windows)

In addition to Rust, BUS/RT has also bindings for the following languages:

Rust crate: https://crates.io/crates/busrt

§Real-time safety

Use rt feature to use for internal mutexes parking_lot_rt - a parking_lot fork without spin-locks, which is real-time safe.

§Technical documentation

The full documentation is available at: https://info.bma.ai/en/actual/busrt/

§Some numbers

§Benchmarks

CPU: i7-7700HQ

Broker: 4 workers, clients: 8, payload size: 100 bytes, local IPC (single unix socket), totals:

stageiters/s
rpc.call126_824
rpc.call+handle64_694
rpc.call0178_505
send+recv.qos.no1_667_131
send+recv.qos.processed147_812
send.qos.no2_748_870
send.qos.processed183_795

§About the authors

Bohemia Automation / Altertech is a group of companies with 15+ years of experience in the enterprise automation and industrial IoT. Our setups include power plants, factories and urban infrastructure. Largest of them have 1M+ sensors and controlled devices and the bar raises higher and higher every day.

Modules§

borrow
broker
client
comm
common
cursors
ipc
rpc
sync
tools

Macros§

empty_payload

Structs§

Error
FrameData

Enums§

ErrorKind
FrameKind
FrameOp
QoS

Constants§

DEFAULT_BUF_SIZE
DEFAULT_BUF_TTL
DEFAULT_QUEUE_SIZE
DEFAULT_TIMEOUT
ERR_ACCESS
ERR_BUSY
ERR_CLIENT_NOT_REGISTERED
ERR_DATA
ERR_IO
ERR_NOT_DELIVERED
ERR_NOT_SUPPORTED
ERR_OTHER
ERR_TIMEOUT
GREETINGS
OP_ACK
OP_BROADCAST
OP_EXCLUDE
OP_MESSAGE
OP_NOP
OP_PUBLISH
OP_PUBLISH_FOR
OP_SUBSCRIBE
OP_UNEXCLUDE
OP_UNSUBSCRIBE
PING_FRAME
PROTOCOL_VERSION
RESPONSE_OK
SECONDARY_SEP
VERSION

Statics§

AUTHOR

Traits§

IntoBusRtResult

Type Aliases§

EventChannel
Frame
OpConfirm
When a frame is sent, methods do not wait for the result, but they return OpConfirm type to let the sender get the result if required.
SyncEventChannel
SyncOpConfirm

Attribute Macros§

async_trait