GithubHelp home page GithubHelp logo

tideland / gocells Goto Github PK

View Code? Open in Web Editor NEW
68.0 4.0 7.0 2.3 MB

Event Based Applications [DEPRECATED]

License: BSD 3-Clause "New" or "Revised" License

Go 100.00%
golang tideland eda cep event-driven event-stream event-processing go library data-stream

gocells's Introduction

Tideland Go Cells

Description

The Tideland Go Cells provide a package for the creation of event based applications with networked concurrently working cells. The way how they process the recevied events is defined by behaviors. During the processing of an event a cell can emit multiple events to its subscribers.

I hope you like them. ;)

GitHub release GitHub license GoDoc Sourcegraph Go Report Card

Version

Version 6.0.0-beta.2017-08-20

Packages

Cells

Major package providing the infrastructure for event based applications. It is organized as an environment of networked cells. Each cell is controlled by its behavior implementing the according interface. It receives events, processes them, and can emit a number of new events during this time. Those events are then received by those cells which subscribed to the individual cell.

For the implementation of own behaviors the EventSink, the EventSinkAccessor, and the EventSinkAnalyzer provide help for their tasks.

Behaviors

The project already contains some standard behaviors, the number is still growing.

  • Aggregator aggregates events and emits each aggregated value.
  • Broadcaster simply emits received events to all subscribers.
  • Callback calls a number of passed functions for each received event.
  • Collector collects events which can be processed on demand.
  • Combo waits for a user-defined combination of events.
  • Condition tests events for conditions using a tester function and calls a processor then.
  • Countdown counts a number of events down to zero and executes an event returning function. The event will be emitted then.
  • Counter counts events, the counters can be retrieved.
  • Evaluator evaluates events based on a user-defined function which returns a rating.
  • Filter re-emits received events based on a user-defined filter. It can be selective or excluding.
  • Finite State Machine allows to build finite state machines for events.
  • Key/Value collects and emits payloads grouped by topics.
  • Logger logs received events with level INFO.
  • Mapper maps received events based on a user-defined function to new events.
  • Once calls the once function only for the first event it receives.
  • Pair checks if the event stream contains two matching ones based on a user-based criterion in a given timespan.
  • Rate measures times between a number of criterion fitting events and emits the result.
  • Rate Window checks if a number of events in a given timespan matches a given criterion.
  • Round Robin distributes events round robin to its subscribers.
  • Sequence checks the event stream for a defined sequence of events discovered by a user-defined criterion.
  • Simple Processor allows to not implement a behavior but only use one function for event processing.
  • Status receives and processes status events by other behaviors. Those have to emit it when receiving the topic "status" with a status cell ID as payload.
  • Ticker emits tick events in a defined interval.
  • Topic/Payloads collects payloads per topic, processes them and emits the result payload.

Example

An example application using the Tideland Go Cells to analyze a stream of crypto coin information. It's called coinalyzer. Later extensions may correlate it with news streams.

Contributors

License

Tideland Go Cells is distributed under the terms of the BSD 3-Clause license.

gocells's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gocells's Issues

Add Event Sink Analyzer

  • Helper for own functions working on EventSinkAccessors
  • Provides total timespan, min and max timespan, avg timespan
  • Same for filtered events
  • More to be defined

Add Event Rate Counter Behavior

Checks the rate of events matching a given criterion in a specified time span. A few events may be tolerated. but after a threshold within a time period is reached an according event has to be emitted.

Add Aggregator Behavior

  • User-defined function gets interface and event as argument
  • Returned event is stored and used with next event
  • Returned event will be emitted to subscribers

Add EventSinkProcessor to RateWindowBehavior

  • RateWindowBehavior today emits a fixed payload
  • This payload doesn't help a lot
  • An additional EventSinkProcessor called with the collected events can return a more useful payload

Add Key/Value Behavior

  • Consumes events carrying a key and a value as payload
  • Collects the values per key
  • Emits key with all collected value
  • Configuration controls number of kept values
  • Configuration controls duration for keeping value

Add Waiter Behavior

  • Behavior gets a waiter as argument
  • The payload of a received event will be set in the waiter
  • It can be retrieved externally

Add option for subscriptions with topic filtering

Right now an emit by a cell is received by all subscribers, they have to filter the topic on their own. To keep the business logic clean and also to allow more generic behaviours a filtered subscription would be useful (function or list of topics).

Add Waiter Payload

  • Interface WaiterPayload
  • Method Waiter() PayloadWaiter
  • Environment.Request()uses WaiterPayload
  • PayloadWaiter will be an extra field in Payload implementation
  • Need also possibility to pass payloads to requests

Add Countdown Behavior

  • Started with number to count down and function
  • Function is called when countdown reached zero
  • Function returns payload
  • Payload will be emitted by the cells afterwards

Add Event Rate Window Behavior

Action is required after a number of same events in a specified time period. Similar to rate counter, but focussed on shorter bursts.

Create example package

  • Own package example
  • Creates according binary
  • Has to receive data from a stream, e.g. Twitter or crypto coins
  • Does according analysis, e.g. based on keywords, rates, changes in value
  • Logs alerts, special values, etc. on the screen

Add Rater Behavior

  • User-defined function receives event and returns float as rate
  • Behavior emits highest rate, lowest rate, number of events, average rate
  • Reset event sets everything to zero again

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.