Giter Club home page Giter Club logo

Comments (6)

themartorana avatar themartorana commented on August 24, 2024 1

@piotrpio I commented on the PR as well, but for our purpose, sometimes we hand messages around multiple services or handlers before responding to a client, and need to be able to pass the reply subject to the down-line code. Easy to do with nats.Msg, but not micro.

from nats.go.

piotrpio avatar piotrpio commented on August 24, 2024 1

@mcosta74, @themartorana Sorry it took so long and thank you for the patience. We discussed it internally and agreed that we will not consider adding public methods to interfaces a breaking change for the client. We have done it in the past with JetStreamContext so we can do the same for micro. I've created a PR adding a note about that to readme to make it official.

I'll review your PR in a moment, on first glance it looks simple and straightforward enough 😉

from nats.go.

piotrpio avatar piotrpio commented on August 24, 2024

Hey @mcosta74. It's a good idea to add the ability to check reply subject, but I'm not sure about introducing a new interface... That would force us to also add v2 of Handler interface, along with Handle method and HandlerFunc.

Another idea would be to add a RespondOpt which would allow skipping sending the response if reply is empty, but that's not ideal as well since you'd not know whether the response was sent or not.

from nats.go.

mcosta74 avatar mcosta74 commented on August 24, 2024

Hi @piotrpio , my need is to know if I need to prepare/Marshall the response or I can skip it because there isn't a Reply.

So your 2nd option doesn't fit what I'm looking for.

from nats.go.

mcosta74 avatar mcosta74 commented on August 24, 2024

That would force us to also add v2 of Handler interface, along with Handle method and HandlerFunc.

As I said, I'll be happy to implement the change of the proposal is accepted

from nats.go.

mcosta74 avatar mcosta74 commented on August 24, 2024

@piotrpio Can I just add a Reply() method to the Request interface? Is adding a new method the the interface considered a breaking change ?

from nats.go.

Related Issues (20)

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.