Home - fulmicotone/com.fulmicotone.util.concurrent.tree GitHub Wiki

TreeLime is a java component that try to simplifies a producer / consumer pattern. We imagined the component as a fruit tree where each consumer (lime) listening on its queue (root/wire) and is interconnected with others. (I think this Isn't just the weed, but for give to memory simple images references.)

The Main concepts:

  • Tree Creates, Configures and Retrieves Consumers.
  • Lime is a consumer, it manage the cycle of item retrieving and elaborates it through his act function.
  • Act is the consumer function

What it does:

  • smoothly create consumer without knowing any concurrency concept.
  • connect output of one consumer with others
  • wait until all consumers have finished
  • stop whole tree and consumers after inactivity expressed in millis
  • stop consumer after inactivity expressed in millis
  • resubmit a consumer if it's terminated unexpected
  • follow the tree life cycle through a custom interface
  • intercept each item that has been submitted to the tree, through a monitor runnable

Follows an accurate graphical representation

  • A Fruits Consumers area
  • B Trunk Commons Area here can intercept any item added
  • C Roots Each root is related to a fruit. It's a tool to submit an item inside a fruit.