Euphrates

Euphrates is a flow execution engine written in Java. The purpose of Euphrates is to simplify development of highly concurrent and distributed Java applications.

Product components

  • Flow editor - Eclipse plug-in for editing flow definitions.
  • Specification - interfaces and foundation classes for constructing flows.
  • Engine - Implementation of specification interfaces.

License

Version

Value proposition

Utilize modern multi-core computers better leveraging data and task parallelism without having to deal explicitly with threading, synchronization, and data consistency.

Requirements

Resources and downloads

Specification

Implementation

General

Concepts

Thinking in flows

Java developers think in objects, object associations, method invocations, inheritance, polymorphism, etc. For a number of scenarios the flow paradigm is a better fit. Flow developers think in terms of processing nodes, which are objects, and data and control flowing concurrently between nodes through transitions.

Back-end

Back-end is an object to which the flow routes outbound invocations. It is purposed to simplify integrating flows into Java applications.

Facade interface

If facade interface is set for the flow, then the flow creates a dynamic proxy implementing the interface. Proxy method invocations are routed to flow pins with matching names. The purpose of the facade interface is to simplify integrating flows into Java applications.

Flow

Flow is a collection of flow elements - nodes and transitions. Flow is itself a node, so flows can be nested.

Invocable

Invocable is a receptor of invocations (activations). Transition starts and node inputs are invocables.

Invocation

Euphrates invocation extends semantics of Java method invocation. It consists of:

  • Flow state, maps to the obj argument of Method.invoke(Object obj, Object... args).
  • Positional arguments, maps to the args argument of Method.invoke(Object obj, Object… args).
  • Named arguments - property sets.
  • Contextual information.

Invoker

Invokers invoke/activate invocables. Transition ends and node outputs are invokers.

Node

Nodes are primary processing units. A node has one or more pins. Nodes are activated by invocations arriving from incoming transitions.

Transition

Transitions connect node pins and pass invocations between pins/nodes. Transitions can modify invocation data along the way, stop invocation propagation, or perform several invocations of target invocable in response to incoming invocation.

Pin

Pins are node connection points. Each pin can have multiple inbound and outbound transitions. Nodes can implement different merge/join logic for incoming invocations. Euphrates Engine provides a helper class for implementing join/merge logic.

Property set

PropertySet is a set of name/value pairs, similar to java.util.Map. The distinguishing features of Euphrates property sets are:

  • Asynchronous/delayed/lazy computation of values. Node or transition can put uncomputed value to a property set (java.util.concurrent.Callable) for later retrieval in other nodes/transitions. The property set will calculate the value asynchronously in a separate thread (for cook() methods) or on demand (for lazy() method).
  • Chaining of property sets with forward-only modification semantics.

Synapse

Synapse is an interceptor of invocations. Synapses are provided by the flow engine. Synapses are responsible for:

  • Infinite loop detection.
  • Dispatching a work request (processing of invocation by invocable) to a worker (Task parallelism). It can be execution in a separate thread by a ThreadPoolExcecutor, or writing a work request to a database for manual execution, or sending a work request to another system over HTTP or JMS.
  • Property set chaining.
  • Converting a single invocation to zero or more invocations if one or more arguments are TokenIterable (Data parallelism).

Contracts

This section describes responsibilities of flow developer, flow engine and client code.

Flow developer

Flow developer is responsible for

  • Implementation of flow, node, and transition classes.
  • Creation of a flow definition file.

Client code

  • Loads flow definition (see Configurator client code).
  • Compiles flow definition to Configurator definition, if it is not yet compiled, with FlowCompiler.
  • Instantiates the flow as shown in the aforementioned Configurator client code example. Client code shall put appropriate implementations of SynapseFactory and PropertySetFactory to achieve desired qualities of service. E.g.
    • Property sets can be in-memory or persistent.
    • How many threads property sets use for “cooking” of values.
    • Synapses may dispatch invocations to be executed in the caller thread, multiple threads, or on multiple machines in the network.
  • Sets flow back-end object (optionally).
  • Activates the flow either through the facade interface or directly.

Flow engine

  • Instantiates and configures flow, transitions and nodes according to definition.
  • Connects transitions to pins and inserts synapses.
  • Creates facade interface proxy, if the flow uses facade interface.

References

Last modified: 2010/01/11 17:15 by Pavel Vlasov
   
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Locations of visitors to this page
Hammurapi Group