go-gentle

module
v2.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2017 License: MIT

README

Document is a work-in-progress

Go-gentle

Build Status

Talk to external services like a gentleman.

Intro

Package gentle defines Stream and Handler interfaces and provides composable resilient implementations of them.

Stream, Handler and back-pressure

Stream and Handler are our fundamental abstractions to achieve back-pressure. Stream has Get() that emits Messages. Handler has Handle() that transforms given Messages. They are composed altogether as one Stream which could then be pulled by the application's main loop.

Resiliency

Resiliency patterns are indispensable in distributed systems because external services are not reliable at all time. We provide some useful patterns in the forms of Streams/Handlers. They include rate-limiting(NewRateLimitedStream, NewRateLimitedHandler), retry/back-off(NewRetryStream, NewRetryHanddler), bulkhead(NewBulkheadStream, NewBulkheadHandler) and circuit-breaker(NewCircuitBreakerStream, NewCircuitBreakerHandler). Each of them can be freely composed with other Streams/Handlers as one sees fit.

Composability

Developers should implement their own logic in the forms of Streams/Handlers and then compose them, possibly with our resilient counterpart. This package provides basic helpers like AppendHandlersStream, AppendHandlersHandler, etc, to simplify composition.

If simply appending Streams/Handlers is not enough, developers can define Streams/Handlers with advanced flow controls, like these resilience Streams/Handlers provided in this package.

Document

GoDoc

Install

The master branch is considered unstable. Use semantic versioning and verdor this library.

If you're using glide, simply run:

glide get gopkg.in/cfchou/go-gentle.v2
glide update

If you're not using package management tools, then

go get http://gopkg.in/cfchou/go-gentle.v2/gentle

Directories

Path Synopsis
Package gentle defines Stream and Handler interfaces and provides composable resilient implementations of them.
Package gentle defines Stream and Handler interfaces and provides composable resilient implementations of them.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL