Code Monkey home page Code Monkey logo

Comments (4)

mdavidsaver avatar mdavidsaver commented on June 8, 2024

When you say "all pvs across all the servers", have you considered servers coming up and going down over time?

I do have a plan, and some very early prototyping, of an API. It currently appears on my very volatile ci branch. I would summarize the current interface design as:

struct Discovered {
    std::string peer;
    std::string server;
    ServerGUID guid;
};
class PVXS_API Context {
    ...
    DiscoverBuilder discover(std::function<void(const Discovered &)> &&);

This is enough to implement a pvlist-like executable, but I think it needs more work. Specifically, I'd like to handle notification when a server going offline as well. This would allow something like casw to ~efficiently manage a list of active servers without having to repeatedly spam with global discovery broadcasts (as pvlist does).

from pvxs.

git-AlexS avatar git-AlexS commented on June 8, 2024

When you say "all pvs across all the servers", have you considered servers coming up and going down over time?

Good point - no, all I do is gather the pvs on initialisation. Even better, using something like casw to passively monitor available servers would be ideal, so I'm glad to hear that it's in active development! Where in ci is your prototype?

from pvxs.

mdavidsaver avatar mdavidsaver commented on June 8, 2024

A place to start is the pvxlist executable https://github.com/mdavidsaver/pvxs/blob/ci/tools/list.cpp

from pvxs.

mdavidsaver avatar mdavidsaver commented on June 8, 2024

Starting with 0.3.0, pvxslist -w 0 combines a one-shot discovery ping with continuing reception of beacons to detect servers comes up and going down (like casw). This is based on an evolution of the Context::discover() method mentioned above.

$ pvxlist -h
Usage:
  Discover Servers:
    ./bin/linux-x86_64/pvxlist [options]

  List PVs:
    ./bin/linux-x86_64/pvxlist [options] <IP[:Port] ...>

  Server Info:
    ./bin/linux-x86_64/pvxlist [options] -i <IP[:Port] ...>

Examples:
  Monitor server beacons to detect servers coming online, and going offline.
   ./bin/linux-x86_64/pvxlist -w 0 -v

  List all PV names.  (Warning: high network load)
   ./bin/linux-x86_64/pvxlist -w 5 | ./bin/linux-x86_64/pvxlist

  -h        Show this message.
  -V        Print version and exit.
  -A        Active discovery mode (default).  Send broadcast ping, then continue
            listening for Beacons.
            Warning: Active discovery pings result in a lot of network traffic.
  -p        Passive discovery mode.  Only listen for server Beacons.
  -i        Query server info.  Requires address(es)
  -v        Make more noise.
  -d        Shorthand for $PVXS_LOG="pvxs.*=DEBUG".  Make a lot of noise.
  -w <sec>  Operation timeout in seconds.  Default 5 sec.  '0' disables timeout,
            useful in combination with '-v'.

from pvxs.

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.