Java Chute

Classes for simplifying producer/consumer parallel processing.

License

License

GroupId

GroupId

com.pervasivecode
ArtifactId

ArtifactId

chute
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

Java Chute
Classes for simplifying producer/consumer parallel processing.
Project URL

Project URL

https://github.com/JamieFlournoy/java-chute
Source Code Management

Source Code Management

https://github.com/JamieFlournoy/java-chute

Download chute

How to add to project

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

Dependencies

runtime (3)

Group / Artifact Type Version
com.google.guava : guava jar 27.0.1-jre
com.pervasivecode : time-utils jar 1.0
com.google.auto.value : auto-value-annotations jar 1.6.3

Project Modules

There are no modules declared in this project.

Pervasive Code's Java Chute

This library includes classes for simplifying producer/consumer parallel processing using a channel-like data structure called a Chute.

Chute?

A Chute is a closable conduit from producers to consumers of objects of a given type. It is unidirectional and typed, similar to a bounded queue but with a substantially smaller API than [java.util.Queue][Queue].

The API is deliberately limited to operations that are suited to a pool of competing workers. Additionally, the producer and consumer interfaces are separate (ChuteEntrance and ChuteExit), easing implementation of delegating wrapper classes that enhance basic chutes. Several examples of such classes are included with this library:

  • a multiplexer, allowing multiple producers to feed a single ChuteEntrance, with the ChuteEntrance only becoming closed when all of the producers have signaled that they are finished;
  • a transforming entrance and a transforming exit, allowing flexibility in deciding whether producers or consumers execute the transformation function;
  • an Iterable implementation that represents a ChuteExit in a way that is easy to use in a foreach loop, and which is suitable for such use by multiple workers, each of which will see their own subset of the Chute's contents;
  • executable workers that process elements taken from a ChuteExit, putting the results into a ChuteEntrance; and
  • a wrapper that allows a nonblocking listener to handle elements from a large number of ChuteExits.

Overview of included classes

Javadocs are available on javadoc.io:

Javadocs

See the separate OVERVIEW.md file for a description of what interfaces and classes are included. (Overview content is taken from class Javadoc comments, so there's no need to read both.)

Alternatives to this library

A list of alternatives to this library is included to help you determine whether this library is right for you.

Including it in your project

Use groupId com.pervasivecode, name chute, version 1.0 in your build tool of choice.

Gradle Example

If you are using Gradle 4.x, put this in your build.properties file:

// in your build.gradle's repositories {} block:
    mavenCentral();

// in your build.gradle's dependencies {} block:
    implementation 'com.pervasivecode:chute:1.0'

    // or, if you prefer the separated group/name/version syntax:
    implementation group: 'com.pervasivecode', name: 'chute', version: '1.0'

How to use it in your code

See the Example Code section in OVERVIEW.md for details.

Contributing

See DEVELOPERS.md and GRADLE_INTRO.md if you want to build and hack on the code yourself.

Copyright and License

Copyright © 2018 Jamie Flournoy.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Versions

Version
1.0
0.10
0.9