Giter Club home page Giter Club logo

Comments (5)

pgermishuys avatar pgermishuys commented on July 29, 2024

Definitely!

from goes.

SeanFarrow avatar SeanFarrow commented on July 29, 2024

I'm thinking we should have a consume method on the subscription that returns two channels and an error, the first channel would provide access to the events rendered to that subscription and the second would provide access to the reason a subscription was terminated.

This would then allow the use of the select block to iterate over messages appearing on both channels simultaneously.
How does this sound? Also, what tests should we have for this?

from goes.

pgermishuys avatar pgermishuys commented on July 29, 2024

@SeanFarrow i'm keen to see how this would work out. Is this a bad approach? https://github.com/pgermishuys/goes/blob/master/eventstore/subscription.go#L47

from goes.

SeanFarrow avatar SeanFarrow commented on July 29, 2024

@pgermishuys,
I'm not saying it's a bad idea, just that it's not as go centric as other messaging solutions.

If you look at the way amqp does this,
here
You create a channel, which would be equivalent to a subscription, then consume from that, giving you a go channel, which closes once no more items are available.

Given the client provides the reason why the subscription was terminated, I'm suggesting we do one of the following:
Either add an item envelope structure that can either hold an event or an object detailing why the subscription terminated.
Or (the prefered option), Have two channels returned from a consume method on the subscription that could both be iterated over.
Having a consume method would replace start in my thinking. so you would create the subscription, then consume from it.

Hope that makes sense.

from goes.

pgermishuys avatar pgermishuys commented on July 29, 2024

It makes sense! thanks for the explanation!
Let's do it!

from goes.

Related Issues (2)

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.