Project

minidisc

0.0
No commit activity in last 3 years
No release in over 3 years
Mini service discovery
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 10.4, >= 10.4.2
>= 3.5.0, ~> 3.5

Runtime

~> 3.0, >= 3.0.1
 Project Readme

MiniDisc

Mini service discovery in Ruby

Description

I recently extracted MiniDisc from a personal project I've been working on. It offers a single line interface for common patterns in service discovery that I'd been redundantly implementing.

Under the hood it wraps the DNSSD gem and is cross compatible with services using that. It adds helpers for common tasks like matching services by name, dynamically overriding discovery, error handling, logging

Requirements

Linux

  • dns-sd
  • avahi 0.6.25+ (plus libavahi-compat-libdnssd-dev on Debian)

Usage

To broadcast a service use something like:

require "minidisc"

MiniDisc::Network.add(:http, 8080, id: "my-service-instance1")

To discover other services use

MiniDisc::Network.find_all(:http, id: /^my-service/) do |services|
  ...
end

Installation

gem install minidisc

or when Bundler, add this to your Gemfile

gem "minidisc"

License

Apache 2.0, See LICENSE file

Copyright (c) 2017-2019 Ari Russo