Giter VIP home page Giter VIP logo

rollcall's Introduction

rollcall

Two ruby scripts that can ask anyone that's listening for their hostname and number of cores.

ruby server_info_control.rb start: listen on port 33333 for someone to request their stats, then respond on port 33334. "I am an available server to test on".

ruby server_info_control.rb stop: stop listening/responding. "..."

require 'rollcall'
test_server_info = Rollcall.call_roll

Broadcast to port 33333 to solicit information, then listen for responses for 2 seconds on port 33334.

p test_server_info
=> { "new-test-machine-<uuid>.local" => {cores: 8, role: :test_0}, "new-test-machine-<other-uuid>.local" => {cores: 16, role: :test_1}}

Based on super handy code examples on betterlogic.com

Specifically this one: http://betterlogic.com/roger/2009/06/ruby-udp-broadcast-simple-example/

And this one: http://betterlogic.com/roger/2010/03/ruby-udp-socket-example/

rollcall's People

Contributors

aduane avatar

Watchers

 avatar

rollcall's Issues

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.