Code Monkey home page Code Monkey logo

Comments (1)

jsiwek avatar jsiwek commented on August 18, 2024

When trying to access a field of type caf::node_id e.g. through a status update (status.context().node) Python exits with the error in the title.
As the error says the type from libcaf cannot be converted to a Python object, which makes sense, as broker does not ship with libcaf Python bindings.

Is this intended behaviour? If so then the caf types should probably not be exposed to Python at all (see: _broker.cpp).

I just removed the EndpointInfo.node() method as to minimize how much the CAF dependency is exposed here.

We would really like to use the node id in our project though, is there any supported way of doing so?
For the moment we discovered that context.__repr__ looks like it contains the node id, which lets an endpoint identify its peers (on status updates) but as Endpoint::node_id is not bound at all the endpoint cannot get its own id.

Yes, I agree being able to obtain the node ID string is helpful. Via
df6525e, there's now the additional repr() available for Endpoint that prints a node ID, and additionally I've just made explicit node_id() methods for both Endpoint and EndpointInfo.

This is just one example of unconvertible objects. endpoint.peers() is unable to convert std::vector<broker::peer_info, std::allocator<broker::peer_info>>. Unfortunately we are not sure if this happens because of the vector itself, broker::peer_info or the std::allocator.

This should be fixed via 7582523.

from broker.

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.