Coder Social home page Coder Social logo

soyacen / pubsub Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 4.5 MB

Easy to use and understand pubsub pattern,Easy to integrate Kafka、RabbitMQ or other pubsub(Message Queue)implementations

License: MIT License

Go 100.00%
go pubsub kafka rabbitmq message-queue golang

pubsub's Introduction

Easypubsub

Easypubsub implements the Pub/Sub message flow for Golang. Pub/Sub allows services to communicate asynchronously. Easypubsub also can build event driven applications.

Why Pub/Sub

  • Pub/Sub allows services to communicate asynchronously, with latencies on the order of 100 milliseconds.

  • Pub/Sub is used for streaming analytics and data integration pipelines to ingest and distribute data. It is equally effective as messaging-oriented middleware for service integration or as a queue to parallelize tasks.

  • Pub/Sub enables you to create systems of event producers and consumers, called publishers and subscribers. Publishers communicate with subscribers asynchronously by broadcasting events, rather than by synchronous remote procedure calls (RPCs).

  • Publishers send events to the Pub/Sub service, without regard to how or when these events will be processed. Pub/Sub then delivers events to all services that need to react to them. Compared to systems communicating through RPCs, where publishers must wait for subscribers to receive the data, such asynchronous integration increases the flexibility and robustness of the system overall.

Pub/Subs

Easypubsub provides universal interfaces for publisher and subscriber

type (
    PublishResult struct {
        Err    error
        Result interface{}
    }
    
    Publisher interface {
        Publish(topic string, msg *Message) (result *PublishResult)
        io.Closer
        fmt.Stringer
    }
)

type Subscriber interface {
    Subscribe(ctx context.Context, topic string) (<-chan *Message, <-chan error)
    io.Closer
    fmt.Stringer
}

Pipe

Pipe combines subscriber and Publisher, abstracts source and sink to process data streams,

Examples

kafka

rabbitmq

io

...

pubsub's People

Contributors

soyacen avatar

Stargazers

 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.