netty-batch-flusher

A batch flusher for Netty

License

License

Categories

Categories

Net Netty Networking
GroupId

GroupId

com.spotify
ArtifactId

ArtifactId

netty-batch-flusher
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

netty-batch-flusher
A batch flusher for Netty
Project URL

Project URL

https://github.com/spotify/netty-batch-flusher
Source Code Management

Source Code Management

https://github.com/spotify/netty-batch-flusher

Download netty-batch-flusher

How to add to project

<!-- https://jarcasting.com/artifacts/com.spotify/netty-batch-flusher/ -->
<dependency>
    <groupId>com.spotify</groupId>
    <artifactId>netty-batch-flusher</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.spotify/netty-batch-flusher/
implementation 'com.spotify:netty-batch-flusher:0.1.0'
// https://jarcasting.com/artifacts/com.spotify/netty-batch-flusher/
implementation ("com.spotify:netty-batch-flusher:0.1.0")
'com.spotify:netty-batch-flusher:jar:0.1.0'
<dependency org="com.spotify" name="netty-batch-flusher" rev="0.1.0">
  <artifact name="netty-batch-flusher" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.spotify', module='netty-batch-flusher', version='0.1.0')
)
libraryDependencies += "com.spotify" % "netty-batch-flusher" % "0.1.0"
[com.spotify/netty-batch-flusher "0.1.0"]

Dependencies

provided (2)

Group / Artifact Type Version
io.netty : netty-all jar 4.0.34.Final
com.google.code.findbugs : jsr305 jar 3.0.0

test (6)

Group / Artifact Type Version
org.mockito : mockito-core jar 1.10.19
junit : junit jar 4.12
org.slf4j : slf4j-simple jar 1.7.7
ch.qos.logback : logback-core jar 1.1.2
org.hamcrest : hamcrest-core jar 1.3
org.hamcrest : hamcrest-library jar 1.3

Project Modules

There are no modules declared in this project.

Build Status

An implementation of natural batching for netty channels to gather writes into fewer syscalls.

Usage

Replace calls to Channel.flush() and ChannelHandlerContext.flush() with calls to BatchFlusher.flush(). BatchFlusher will then gather multiple flushes into fewer calls to Channel.flush().

At that point the actual gathering write can be left to Netty to perform using the underlying GatheringByteChannel. Alternatively the write() and flush() methods of ChannelOutboundHandler can be implemented to perform custom e.g. ByteBuf consolidation.

pom.xml

<dependency>
  <groupId>com.spotify</groupId>
  <artifactId>netty-batch-flusher</artifactId>
  <version>0.1.0</version>
</dependency>

License

This software is licensed using the Apache 2.0 license. Details in the file LICENSE

com.spotify

Spotify

Versions

Version
0.1.0