#interprocess-communication #rpc #message-bus #rpc-service #ipc #rpc-client #service

aldrin-broker

Broker library of Aldrin, a message bus for service-oriented RPC and interprocess communication

10 breaking releases

new 0.11.0 Jan 7, 2025
0.10.0 Nov 26, 2024
0.9.0 Nov 19, 2024
0.7.0 Jul 25, 2024
0.0.0 Feb 14, 2020

#1378 in Network programming

Download history 150/week @ 2024-09-20 26/week @ 2024-09-27 5/week @ 2024-10-04 9/week @ 2024-10-11 4/week @ 2024-10-18 3/week @ 2024-11-01 1/week @ 2024-11-08 154/week @ 2024-11-15 167/week @ 2024-11-22 22/week @ 2024-11-29 5/week @ 2024-12-06 2/week @ 2024-12-13 100/week @ 2025-01-03

104 downloads per month
Used in aldrin-test

MIT/Apache

795KB
21K SLoC

Aldrin

Crates.io Crates.io Build status

Aldrin is a message bus for service-oriented RPC and general interprocess communication.

Aldrin busses are star-shaped: there is a cental component, called the broker, to which multiple clients can connect. These client can then publish services for other clients to use.

Services are described in a small DSL called Aldrin schema and are composed of functions and events. Schemata are then processed by a code generator, which can output both client and server-side code.

Here is a small toy example of an echo service:

service Echo {
    uuid = 8920965f-110a-42ec-915c-2a65a3c47d1f;
    version = 1;

    fn echo @ 1 {
        args = string;
        ok = string;

        err = enum {
            EmptyString @ 1;
        }
    }

    fn echo_all @ 2 {
        args = string;

        err = enum {
            EmptyString @ 1;
        }
    }

    event echoed_to_all @ 1 = string;
}

Crate organization

  • aldrin: This is the main crate, aimed at writing both client and server applications.
  • aldrin-broker: Implements the broker-side of the protocol.
  • aldrin-core: Shared protocol primitives used by aldrin and aldrin-broker.
  • aldrin-test: Utilities for setting up unit tests of Aldrin services.
  • aldrin-parser: Parser library for Aldrin schemata.
  • aldrin-codegen: Implements client and server code generation from Aldrin schemata.
  • aldrin-gen: Standalone frontend to the parser and code generation.
  • aldrin-macros: Contains a macro for code generation at compile-time.

Dependencies

~1.2–8MB
~63K SLoC