Utilities to build and work with Netty pipelines
Utilities to build and work with Netty pipelines
Thread-local binding for a channel
Thread-local binding for a channel
(build-pipeline handlers chan)
Build a pipeline from a list of handlers. Binds *channel*
to
the given chan
argument and runs through handlers.
When handlers are functions, call them with no arguments, otherwise add them directly to the ChannelHandler list.
Yields an array of ChannelHandler instances
Build a pipeline from a list of handlers. Binds `*channel*` to the given `chan` argument and runs through handlers. When handlers are functions, call them with no arguments, otherwise add them directly to the **ChannelHandler** list. Yields an array of **ChannelHandler** instances
(channel-initializer pipeline)
Build a channel initializer from a pipeline, expressed as a
sequence of ChannelHandler, see build-pipeline
for how
to express this.
Build a channel initializer from a pipeline, expressed as a sequence of **ChannelHandler**, see `build-pipeline` for how to express this.
Implement this protocol when you want your adapter to be notified for channel activation.
Implement this protocol when you want your adapter to be notified for channel activation.
(channel-active this ctx)
Called when the channel becomes active
Called when the channel becomes active
Implement this protocol when you want your adapter to be notified for channel deactivation.
Implement this protocol when you want your adapter to be notified for channel deactivation.
(channel-inactive this ctx)
Called when the channel becomes inactive
Called when the channel becomes inactive
Implement this protocol when you want your adapter to be notified of a read complete status.
Implement this protocol when you want your adapter to be notified of a read complete status.
(channel-read-complete this ctx)
Called when read has completed
Called when read has completed
Implement this protocol when you want your adapter to be notified for channel registration.
Implement this protocol when you want your adapter to be notified for channel registration.
(channel-registered this ctx)
Called upon channel registration
Called upon channel registration
Implement this protocol when you want your adapter to be notified for channel deregistration.
Implement this protocol when you want your adapter to be notified for channel deregistration.
(channel-unregistered this ctx)
Called when channel is deregistered
Called when channel is deregistered
Implement this protocol when you want your adapter to be notified of changes in channel writability.
Implement this protocol when you want your adapter to be notified of changes in channel writability.
(channel-writability-changed this ctx)
Called when writability has changed on a channel
Called when writability has changed on a channel
converts to a CharsetUtil
converts to a CharsetUtil
(defdecoder sym [msg ctx shareable?] & body)
Define decoders
Define decoders
(defencoder sym [msg ctx shareable?] & body)
Define encoder
Define encoder
Implement this protocol when you want your adapter to be notified of channel exception.
Implement this protocol when you want your adapter to be notified of channel exception.
(exception-caught this ctx e)
Called for channel exceptions
Called for channel exceptions
This is the minimum an adapter must implement to be proxied to a valid ChannelHandlerAdapter
This is the minimum an adapter must implement to be proxied to a valid ChannelHandlerAdapter
(channel-read this ctx input)
Called for each new payload on a channel
Called for each new payload on a channel
Implement this protocol for adapters when you want to report whether the adapter can be shared or not. When not implemented adapters will be deemed unsharable.
While it may look more natural to write sharable as shareable, it is apparently valid english and is the way netty spells it out.
Implement this protocol for adapters when you want to report whether the adapter can be shared or not. When not implemented adapters will be deemed unsharable. While it may look more natural to write sharable as shareable, it is apparently valid english and is the way netty spells it out.
(is-sharable? this)
Returns whether the handler adapter is sharable
Returns whether the handler adapter is sharable
(length-field-based-frame-decoder)
(length-field-based-frame-decoder {:keys [byte-order max offset length adjust
strip fail-fast?]})
Create a length field based frame decoder.
Create a length field based frame decoder.
(length-field-prepender)
(length-field-prepender {:keys [length byte-order adjust includes-length?]})
Creates an encoder that adds length-fields
Creates an encoder that adds length-fields
(line-based-frame-decoder)
(line-based-frame-decoder max-length)
(line-based-frame-decoder max-length strip-delimiter?)
(line-based-frame-decoder max-length strip-delimiter? fail-fast?)
Builds a ChannelHandler which parses lines.
Builds a ChannelHandler which parses lines.
(line-frame-encoder)
Encode outbound payloads as lines, appending telnet-style carriage returns
Encode outbound payloads as lines, appending telnet-style carriage returns
(make-handler-adapter adapter)
From an implemenation of net.ty.pipeline.HandlerAdapater, yield a proxied ChannelInboundHandlerAdapter.
Adapters may optionally implement any or all of the following
protocols: IsSharable
, ChannelActive
, ChannelInactive
,
ChannelReadComplete
, ChannelRegistered
, ChannelUnregistered
,
ExceptionCaught
, ChannelWritabilityChanged
, and
UserEventTriggered
.
To circumvent CLJ-1814 we cover the most common cases and otherwise
build a set of known operations to avoid calling satisfies?
at runtime.
From an implemenation of net.ty.pipeline.HandlerAdapater, yield a proxied ChannelInboundHandlerAdapter. Adapters may optionally implement any or all of the following protocols: `IsSharable`, `ChannelActive`, `ChannelInactive`, `ChannelReadComplete`, `ChannelRegistered`, `ChannelUnregistered`, `ExceptionCaught`, `ChannelWritabilityChanged`, and `UserEventTriggered`. To circumvent CLJ-1814 we cover the most common cases and otherwise build a set of known operations to avoid calling `satisfies?` at runtime.
(read-timeout-handler timeout)
(read-timeout-handler timeout unit)
Build a ChannelHandler which times-out when no payload is read
Build a ChannelHandler which times-out when no payload is read
(string-decoder)
(string-decoder charset)
A decoder that coerces to string
A decoder that coerces to string
(string-encoder)
(string-encoder charset)
A encoder that coerces from strings
A encoder that coerces from strings
Converts to a java util concurrent TimeUnit
Converts to a java util concurrent TimeUnit
Implement this protocol when you want your adapter to be notified of user events.
Implement this protocol when you want your adapter to be notified of user events.
(user-event-triggered this ctx event)
Called when a user event has been triggered on a channel
Called when a user event has been triggered on a channel
(with-input [ctx input] & body)
Inline definition of a ChannelInboundHandlerAdapter which captures context and input and executes body.
Inline definition of a **ChannelInboundHandlerAdapter** which captures context and input and executes body.
(write-and-flush! ctx msg)
Write message to context, then flush context
Write message to context, then flush context
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close