Coder Social home page Coder Social logo

Comments (4)

NimaAra avatar NimaAra commented on July 23, 2024

This is the expected behaviour. In your case you should be subscribing to IMessage.

image

from easy.messagehub.

ValResnick avatar ValResnick commented on July 23, 2024

But i dont want to subscribe to IMessage, because i dont want to have different messages in one subscription.

Only the subscription for MyMessage should be "fired". Because that is the real type. I think you should use GetType in publish instead of typeof(T)?

from easy.messagehub.

NimaAra avatar NimaAra commented on July 23, 2024

Why not? You can simply do:
image

Calling GetType is slow compared to the current solution. Once again the library is behaving as expected. It is not the intention of the library to do runtime type checking. That kind of specific behaviour can be done by yourself.

from easy.messagehub.

ValResnick avatar ValResnick commented on July 23, 2024

Well, then i could only register to the global hook and check every possible messsage there...

In a normal, non high performance, scenario the GetType call will not hurt.

Thanks for your feedback. I will use Reflection to call the "correct" publish method or i take a different Api.

from easy.messagehub.

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.