Project

drbarpg

0.0
No commit activity in last 3 years
No release in over 3 years
A protocol implementation for Distributed Ruby (DRb), supporting connections through a PostgreSQL server by using the LISTEN/NOTIFY event system.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 0
>= 3.0
 Project Readme

drbarpg¶ ↑

<img src=“https://travis-ci.org/larskanis/drbarpg.png?branch=master” alt=“Build Status” />

A protocol implementation for Distributed Ruby (DRb), supporting connections via a PostgreSQL server by using the LISTEN/NOTIFY event system.

This project rocks and uses MIT-LICENSE.

Usage¶ ↑

Add to your Gemfile :

gem 'drbarpg'

Run

$ bundle install
$ rake drbarpg:install:migrations
$ rake db:migrate

Ensure the value of pool in your config/database.yml is high enough (at least 10).

Example server¶ ↑

# Startup your Rails environment to establish database connection.
# Only necessary, if running outside of the rails context.
require 'path/to/config/environment'

# start up the DRb service
DRb.start_service "drbarpg://myserver", []

# wait for the DRb service to finish before exiting
DRb.thread.join

Example client:¶ ↑

# Startup your Rails environment to establish database connection.
# Only necessary, if running outside of the rails context.
require 'path/to/config/environment'

# Start a local DRbServer to handle callbacks.
#
# Not necessary for this small example, but will be required
# as soon as we pass a non-marshallable object as an argument
# to a dRuby call.
DRb.start_service "drbarpg://"

# attach to the DRb server via the server URI
remote_array = DRbObject.new_with_uri("drbarpg://myserver")

p remote_array.size  # => 0

remote_array << 1

p remote_array.size  # => 1

Description¶ ↑

drbarpg makes it possible to create DRb-connections via the connection to a PostgreSQL server. It easily integrates into rails projects and uses the configured database connection for inter process communication.

Method calls with a size of less than 8000 bytes for all serialized parameters are directly passed through by the NOTIFY payload. This bypasses the transaction overhead in the database, so the calls are reasonably fast (approximately 1.5 of the time of a direct DRb-TCP connection). Calls with bigger parameter size are transferred by INSERT/SELECT and require transaction commits, so they usually take several milliseconds.

Requirements¶ ↑

  • PostgreSQL 9.0+

  • Rails 3.0+