Last active
May 3, 2017 13:35
-
-
Save kaos/09720c6838bbfb7b281a to your computer and use it in GitHub Desktop.
MQTT transport for capnp RPC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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