kithara.protocols
Basic protocols outlining kithara Components and their Composability.
coerce-by-keyword
multimethod
(coerce-by-keyword alias body)
Coerce the given byte array using the given, predefined coercer.
Coercer
protocol
Protocol for byte array coercion. This is already implemented for:
- the keyword
:bytes
(returns the original byte array) - the keyword
:string
(returns the byte array as a UTF-8 string) clojure.lang.AFn
(applies the function to the byte array).
You can implement the multimethod coerce-by-keyword to add more aliases.
members
coerce
(coerce coercer body)
Coerce the given byte array using the given coercer.
Consumer
protocol
Protocol for consumers.
members
add-middleware
(add-middleware _ wrap-fn)
Wrap the consumer handler function using the given wrap-fn
.
HasChannel
protocol
Protocol for components depending on a channel.
members
set-channel
(set-channel value channel)
HasConnection
protocol
Protocol for components depending on a connection.
members
set-connection
(set-connection value connection)
HasQueue
protocol
Protocol for components depending on a queue.
members
set-queue
(set-queue value queue)
Wrapper
protocol
Protocol for component wrappers.
members
wrap-components
(wrap-components _ pred wrap-fn)
Apply the given function to each value contained within the wrapper matching the given predicate.