proton_rabbita

Rabbita commands and subscriptions for typed Proton contracts.

proton
rabbita
ipc
moon add justjavac/proton_rabbita@0.1.1
Download zip
Author
Version
0.1.1
License
Apache-2.0
Last updated
13 days ago
Downloads
34
README

#Proton Rabbita

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

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

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

///|
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