Repository is archived
No commit activity in last 3 years
No release in over 3 years
LightCloud library for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

LightCloud Library for Ruby¶ ↑

This is a library for accessing LightCloud systems through Ruby.

Background¶ ↑

LightCloud is a distributed key-value stored open-sourced by Plurk. The official website which includes benchmarks, design specs, and more can be viewed at the following URL:

opensource.plurk.com/LightCloud/

Usage¶ ↑

You can use it with class methods:

require 'rubygems'
require 'lightcloud'

LIGHT_CLOUD = {
  'lookup1_A' => ['127.0.0.1:41401', '127.0.0.1:41402'],
  'storage1_A' => ['192.168.0.2:51401', '192.168.0.2:51402']
}

lookup_nodes, storage_nodes = LightCloud.generate_nodes(LIGHT_CLOUD)
LightCloud.init(lookup_nodes, storage_nodes)

LightCloud.set("hello", "world")
print LightCloud.get("hello") # => world
LightCloud.delete("hello")

print LightCloud.get("hello") # => nil

Or you can also use it with instances:

require 'rubygems'
require 'lightcloud'

LIGHT_CLOUD = {
  'lookup1_A' => ['127.0.0.1:41401', '127.0.0.1:41402'],
  'storage1_A' => ['192.168.0.2:51401', '192.168.0.2:51402']
}

lookup_nodes, storage_nodes = LightCloud.generate_nodes(LIGHT_CLOUD)
cloud = LightCloud.new(lookup_nodes, storage_nodes)

cloud.set("hello", "world")
print cloud.get("hello") # => world
cloud.delete("hello")

print cloud.get("hello") # => nil

Installation¶ ↑

sudo gem install mitchellh-lightcloud

Known Issues / To-Do¶ ↑

The python library actually caches the get/set values in a thread-local hash table. This library doesn’t do this yet but I’m working on adding this in now.