npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

urclient

v1.2.2

Published

Triton ur client

Downloads

6

Readme

node-urclient

This repository is part of the Joyent Triton project. See the contribution guidelines and general documentation at the main Triton project page.

A high-level client for the use of the ur agent in Joyent Triton DataCenter. The client allows the consumer to discover compute nodes (servers) in a Triton DataCenter deployment, copy files to and from those nodes, ping nodes, and run arbitrary commands.

Overview

This library provides two classes:

  • URClient, a client for performing node discovery and interacting with the ur-agent of a single node, via AMQP, for the purpose of running a command or transferring a file.
  • RunQueue, a higher-level orchestration class, capable of performing the same action on an incrementally specified set of remote ur-agent instances, with per-node execution timeouts and starting line synchronisation

The software is basically done, but the documentation is still a work in progress.

URClient; Interacting With A Single Node

discover(); Node Discovery

Create an instance of URClient, thus:

var mod_urclient = require('urclient');

URCLIENT = mod_urclient.create_ur_client({
    log: LOG,
    connect_timeout: 5000,
    enable_http: false,
    bind_ip: '10.0.0.1',
    amqp_config: {
        login: 'guest',
        password: 'guest',
        host: '10.0.0.100',
        port: 5672
    }
});

URCLIENT.on('ready', function () {
    var disco = URCLIENT.discover({
        timeout: 3 * 1000,
        exclude_headnode: false
    });

    disco.on('server', function (server) {
        console.log('found server: %s (%s)', server.uuid, server.hostname);
    });
    disco.on('end', function () {
        console.log('discovery complete');
        process.exit(0);
    });
});

The discover() function returns an event emitter that will emit 'server' events for each server that responds to the discovery request. If the same server responds more than once, only the first response will induce a 'server' event. Once the discovery timeout has expired, an 'end' event will be emitted.

If you need to check for the existence of a specific set of hostnames or UUIDs, provide that list to discover() in the node_list parameter. In this mode, the 'end' event will trigger when all nodes are discovered. An 'error' will be generated in the event that we were not able to find a match for each node in node_list, or if a problem arises with the underlying AMQP transport.

ping(); Ping A Node

TODO: Not Yet Documented

exec(); Execute Script On Node

TODO: Not Yet Documented

send_file(); Send File To Node

TODO: Not Yet Documented

recv_file(); Receive File From Node

TODO: Not Yet Documented

RunQueue; Interacting With A Set Of Nodes

add_server(); Add Node To Set

TODO: Not Yet Documented

start(); Begin Execution On Nodes In Set

You may call start() at any time -- before or after selecting nodes, and before calling close() to finish node selection. This enables you to either configure the entire set in advance and only execute once you have finished discovery, or begin executing immediately as discovery messages are still arriving.

close(); Finish Specifying Set

TODO: Not Yet Documented

'dispatch' event

TODO: Not Yet Documented

'success' event

TODO: Not Yet Documented

'failure' event

TODO: Not Yet Documented

'end' event

TODO: Not Yet Documented

License

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. For the full license text see LICENSE, or http://mozilla.org/MPL/2.0/.

Copyright 2016 Joyent, Inc.