Skip to content

Instantly share code, notes, and snippets.

@kaos
Last active May 3, 2017 13:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaos/09720c6838bbfb7b281a to your computer and use it in GitHub Desktop.
Save kaos/09720c6838bbfb7b281a to your computer and use it in GitHub Desktop.
MQTT transport for capnp RPC
@0xe425876d9fb9589c
# Disclaimer, I'm no pubsub expert, so there may be inconsitencies and
# other errors in concept or layout with regard to how the queues and
# topics work.
interface Broker {
publish (message :Message, topic :Topic) -> (result :Result);
subscribe (subscriber :Subscriber, topic :Topic) -> (result: Result);
}
struct Topic {
id :Text;
# ...?
}
struct Message {
# from: Id; ?
union {
text :Text;
data :Data;
# ...
}
}
interface Subscriber {
handle_message (message :Message, topic :Topic) -> (result: Result);
}
struct Result {
union {
ok :Void; # all ok
failed :Failure;
# ... other results?
}
struct Failure {
# define failures here..
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment