Code Monkey home page Code Monkey logo

Comments (3)

AshleyF avatar AshleyF commented on May 15, 2024

Hey Willie,

You're right that the correct way to receive a structured message on the \psi side is as a dynamic. You should be able to unpack fields simply by knowing the names (e.g. 'message.say'). Or you can treat the underlying 'ExpandoObject' as a dictionary by merely casting it: 'IDictionary<string, object> dict = message;If you really want to convert it to some structured type on the .NET side (or even to a dictionary of strong types), you'd do that with a.Select(...)` unpacking the dynamic and constructing a strong type of your own. It's not automatic.

Hope that helps!

from psi.

AshleyF avatar AshleyF commented on May 15, 2024

Again, I hope that helped. I'm closing this issue, but please feel free to reopen it if you're still having trouble.

from psi.

profwillie avatar profwillie commented on May 15, 2024

Ashley, yes this was helpful. Here's the code I ended up using:

var mqs = new NetMQSource<dynamic>(this, "message-topic", "tcp://127.0.0.1:12002", JsonFormat.Instance); mqs.Select(msg => ((IDictionary<String, Object>)msg)).PipeTo(Out);

I'm working on a video tutorial of how all this works, and I'll share that video.

from psi.

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.