Socket
Book a DemoInstallSign in
Socket

zk_service

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zk_service

0.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

ZK Service

zk_service is a small library which provides a service registry for Zookeeper.

Servers

This library provides registration to zookeeper through a mixin.

This connection can be set by calling,

For example:

class SomeServer
 include ZkService::Publisher

def intialize
  zk_service_Details( 'localhost', '2181', 'superservice' )
  zk_publish("/some/service/path") #Creates an ephemeral node
  #.....
end

def close
  #.....
  zk_unpublish #explicitly removes the ephemeral node
end

Clients

Upon con requiring a connection to a specific service, a client will consult Zookeeper for the child znodes under '/envname/services/service_name'. These nodes will contain connection details.

For example:

class SuperServiceVendor < ZkService::Vendor

  def initialize(host, port)
    super(host, port)
  end

end

Upon initialization, a child connection can be obtained by:

child_connection = SuperServiceVendorInstance.vend('superservice1')

Connection details can be obtained by:

data = SuperServiceVendorInstance.get_data(child_connection)

Issues

*Need to check for the existence of a Zookeeper ENV and grab the hostname and port number.

FAQs

Package last updated on 13 Mar 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.