No description, website, or topics provided.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


GossipGirl provides easy way for distributed Ruby application to organise clusters and exchange state and data between different parts of cluster.


Add this line to your application's Gemfile:

gem 'gossip_girl'

And then execute:

$ bundle

Or install it yourself as:

$ gem install gossip_girl


GossipGirl allow to exchange state and data between nodes, for these purpose you should use next classes:
HeartBeat - allow to exchange states.
DataExchange - allow to exchange data.

HeartBeat Configuration

Example of configuration for HeartBeat:

    :cluster_name => 'TestCluster',
    :address => "tcp://",
    :failure_threshold => 8,
    :beat_interval => 1.2,
    :seeds => {"tcp://" => {}, "tcp://" => {}}

HeartBeat Usage

Example of HeartBeat Usage:

configuration_hash = {
    :cluster_name => 'TestCluster',
    :address => "tcp://",
    :failure_threshold => 8,
    :beat_interval => 1.2,
    :seeds => {"tcp://"=>{}, "tcp://"=>{}}

heartbeat = configuration_hash
f_running = true

trap 'INT' do
  f_running = false

while f_running do


  puts "live_nodes: #{heartbeat.live_nodes}"
  puts "dead_nodes: #{heartbeat.dead_nodes}"

  sleep 1.5


At first we define configuration_hash with some data for new HeartBeat instance. Then in the cycle we check status of all nodes we mentioned like seeds in our configuration_hash


Send message to each node to know is it still live or dead?


Fetch live nodes.


Fetch dead nodes.

DataExchange Configuration

DataExchange not require some specific configuration, you just need creat new instance without any params.

DataExchange Usage

Example of creation new DataExchange instance:

Example of usage:

exchange_file = "path-to-some-file"
exchange_server = "address-of-server-where-we-want-to-send-file"

d_ex =
d_ex.bind "tcp://"

msg = {
    filename: File.basename(exchange_file),
    filesize: File.size(exchange_file),

d_ex.send_data exchange_server, 'file', msg

Binds the socket to an address

.send_data(server, request_type, msg)

Send some data by specified address


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request