Code Monkey home page Code Monkey logo

pipeline's Introduction

Pipelines

Coverage

The purpose of pipelines module is to provide a library based solely off of the standard Golang library for common patterns in data pipelines as well as some convenient function wrappers.

License

MIT License

Usage

Importing

import "github.com/cmargol/pipelines"

When to use

  • Need to set up concurrent workers to process data
  • Part of your code could be defined by a flow chart or state diagram
  • There is a bottleneck that is CPU blocking

When not to use

  • Code does not require any concurrency / not CPU blocking

Concurrency

Error Handling Wrappers

This package comes with function wrappers that are capable of wrapping errors that occur in the Pipeline errors that give functionality to give more context around what pipeline and what stage of the pipeline the error occurred.

Metric Handling Wrappers

This package comes with several functions that can be used to wrap and provide metrics:

  • MetricWrapperQueue : Wraps a queue function
  • MetricWrapperWorker : Wraps a worker function
  • MetricWrapperDequeue : Wraps a dequeue function

Each function takes in a MetricsHandler which is an interface with the following signatures:

  • RecordLastSuccessfulExecution(service string, stage string)
  • RecordExecutionTime(t time.Duration, service string, stage string, status string)
  • IncrementRecordCount(service string, stage string)
  • IncrementErrorCount(service string, stage string)

The wrappers automatically call the according functions when applied, however the actual implementation of the MetricsHandler is left up to choice to prevent locking down the implementation to one solution.

Examples

Contributing

  • Please create a branch with descriptive title and use the PR template included
  • PR with any failing tests will not be reviewed and will automatically be rejected after 30 days

pipeline's People

Contributors

cmargol avatar

Watchers

 avatar

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.