proton_rabbita

    Rabbita commands and subscriptions for typed Proton contracts.

    proton
    rabbita
    ipc
    Download zip
    Version
    0.2.5
    License
    Apache-2.0
    Last updated
    15 days ago
    Downloads
    114

    #Proton Rabbita

    moonbit-community/proton_rabbita maps typed Proton commands and events onto Rabbita Cmd and Sub values. Transport and JSON handling remain owned by moonbit-community/proton_client.

    ///|
    struct PingRequest {
    value : String
    } derive(ToJson)

    ///|
    pub PingRequest with ToJson::{to_json}

    ///|
    struct PingReply {
    value : String
    } derive(FromJson)

    ///|
    pub PingReply with FromJson::{from_json}

    ///|
    test {
    let ping : @proton_contract.Command[PingRequest, PingReply] = @proton_contract.command(
    "ping",
    )
    let request = PingRequest::{ value: "hello", }
    let command = invoke(
    ping,
    request,
    reply => {
    ignore(reply.value)
    @cmd.none
    },
    _error => @cmd.none,
    )
    ignore(command)
    }

    An event subscription installation failure is reported through its failure callback once. Rabbita retains a terminal subscription for that key instead of retrying after every model update, which prevents a failure-message feedback loop. To retry explicitly, omit the subscription for one update and then add it again. The Proton bridge is expected to be available before application frontend code starts.

    invoke

    Invokes a typed Proton command as one Rabbita command.

    Success and failure are separate callbacks so application messages do not need to expose transport-oriented Result values.

    subscribe

    Subscribes to one typed Proton event as a stable Rabbita subscription.

    Recomputing the subscription updates its taggers without reinstalling the renderer listener. A malformed event reports one failure and leaves the subscription active.

    An initial installation failure is reported once and retained as a terminal subscription for that key. This prevents the failure message from causing an immediate retry loop. Remove the subscription for one update and add it again to retry explicitly.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io