amqp-worker-0.4.0: Type-safe AMQP workers
Safe HaskellSafe-Inferred
LanguageHaskell2010

Network.AMQP.Worker.Key

Synopsis

Documentation

newtype Key a msg Source #

Keys describe routing and binding info for a message

Constructors

Key [a] 

Instances

Instances details
Monoid (Key a msg) Source # 
Instance details

Defined in Network.AMQP.Worker.Key

Methods

mempty :: Key a msg #

mappend :: Key a msg -> Key a msg -> Key a msg #

mconcat :: [Key a msg] -> Key a msg #

Semigroup (Key a msg) Source # 
Instance details

Defined in Network.AMQP.Worker.Key

Methods

(<>) :: Key a msg -> Key a msg -> Key a msg #

sconcat :: NonEmpty (Key a msg) -> Key a msg #

stimes :: Integral b => b -> Key a msg -> Key a msg #

Show a => Show (Key a msg) Source # 
Instance details

Defined in Network.AMQP.Worker.Key

Methods

showsPrec :: Int -> Key a msg -> ShowS #

show :: Key a msg -> String #

showList :: [Key a msg] -> ShowS #

Eq a => Eq (Key a msg) Source # 
Instance details

Defined in Network.AMQP.Worker.Key

Methods

(==) :: Key a msg -> Key a msg -> Bool #

(/=) :: Key a msg -> Key a msg -> Bool #

data Binding Source #

A dynamic binding address for topic queues

commentsKey :: Key Binding Comment
commentsKey = key "posts" & star & word "comments" & hash

Constructors

Word BindingWord 
Star 
Hash 

Instances

Instances details
KeySegment Binding Source # 
Instance details

Defined in Network.AMQP.Worker.Key

Show Binding Source # 
Instance details

Defined in Network.AMQP.Worker.Key

Eq Binding Source # 
Instance details

Defined in Network.AMQP.Worker.Key

Methods

(==) :: Binding -> Binding -> Bool #

(/=) :: Binding -> Binding -> Bool #

data Routing Source #

Every message is sent with a specific routing key

newCommentKey :: Key Routing Comment
newCommentKey = key "posts" & word "1" & word "comments" & word "new"

Instances

Instances details
KeySegment Routing Source # 
Instance details

Defined in Network.AMQP.Worker.Key

Show Routing Source # 
Instance details

Defined in Network.AMQP.Worker.Key

Eq Routing Source # 
Instance details

Defined in Network.AMQP.Worker.Key

Methods

(==) :: Routing -> Routing -> Bool #

(/=) :: Routing -> Routing -> Bool #

key :: Text -> Key Routing msg Source #

Create a new key

word :: KeySegment a => Text -> Key a msg -> Key a msg Source #

Match a specific word

star :: KeySegment a => Key a msg -> Key Binding msg Source #

Match any one word

hash :: KeySegment a => Key a msg -> Key Binding msg Source #

Match any words

keyText :: KeySegment a => Key a msg -> Text Source #

class KeySegment a where Source #

Methods

toText :: a -> Text Source #

fromText :: Text -> a Source #

toBind :: a -> Binding Source #

Instances

Instances details
KeySegment Binding Source # 
Instance details

Defined in Network.AMQP.Worker.Key

KeySegment Routing Source # 
Instance details

Defined in Network.AMQP.Worker.Key

bindingKey :: KeySegment a => Key a msg -> Key Binding msg Source #

Convert any key to a binding key