Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Key a msg = Key [a]
- data Binding
- = Word BindingWord
- | Star
- | Hash
- type BindingWord = Text
- data Routing
- key :: Text -> Key Routing msg
- word :: KeySegment a => Text -> Key a msg -> Key a msg
- star :: KeySegment a => Key a msg -> Key Binding msg
- hash :: KeySegment a => Key a msg -> Key Binding msg
- keyText :: KeySegment a => Key a msg -> Text
- class KeySegment a where
- bindingKey :: KeySegment a => Key a msg -> Key Binding msg
Documentation
Keys describe routing and binding info for a message
Key [a] |
A dynamic binding address for topic queues
commentsKey :: Key Binding Comment commentsKey = key "posts" & star & word "comments" & hash
type BindingWord = Text Source #
Every message is sent with a specific routing key
newCommentKey :: Key Routing Comment newCommentKey = key "posts" & word "1" & word "comments" & word "new"
class KeySegment a where Source #
Instances
bindingKey :: KeySegment a => Key a msg -> Key Binding msg Source #
Convert any key to a binding key