Oskie RPC – Network agnostic RPC

Oskie RPC is a simple RPC library and protocol for Ruby.  Main features:

Network agnostic: You provide it with input and receive output using whatever transport mechanism you prefer.  Typically this will be a TCP/IP connection.

Simple protocol: Though it has been developed for Ruby, the network protocol is extremely simple and should work well with any language that supports JSON encoded strings.

Easily modifiable: It was designed from the ground up to be modified both in code and in terms of protocol.  Prefer Message Pack over JSON?  Want to add compression?  All of these and more are easy to accomplish.

Messages and Requests:  Both messages (fire-and-forget) and requests (receive return values) are supported.  This covers the most common forms of communication over a TCP/IP socket.

Bi-directional: Both ends of a network connection are on equal footing once a connection is established.  This gives you great flexibility in designing your application.

Thread safe: Ruby threading has improved greatly over the last few years and is especially useful with JRuby.

Filter Chain – Ruby gem for data manipulation

Filter Chain is a Ruby gem for processing data through a chain of filters in an object oriented style.  It includes a number of filters for simple tasks like compression, serialization, and multiplexing.

It is very common in Ruby to use blocks and functional style programming to manipulate data.  The below example squares each element in an array and then removes the odd values:

[1,2,3,4,5].map { |i| i**2 }.reject { |i| i.odd? }

Such one-liners are an amazing feature of Ruby and very useful on the console.  Unfortunately, they can really start to break down in more complex situations.  This is where Filter Chain can be really useful.

Unlike in the above example, filters in Filter Chain are dedicated classes with a simple API.  This means each filter can easily have it’s own state, private helper methods, independent tests, and be reusable.  This is especially true for filters that include buffering, multithreading, and asynchronous IO.

Reactomatic – Reactor pattern for Ruby

Reactomatic is an implementation of the Reactor Pattern for Ruby.  It provides an EventMachine inspired interface for working with TCP/IP sockets in an asynchronous way.  Low level IO is provided by the nio4r gem so it works well on both MRI and JRuby.  Design goals include thread safety and minimalist API.  Reactomatic wants to do one thing and do it well on all supported platforms.  This means many common EventMachine features may not be included such as application level protocols, timers, and thread pools.

Easy Lua – Add Lua scripts to ActionScript projects

This past weekend I released a new open source project called Easy Lua.  It’s a wrapper around the Lua port that is included in Adobe’s open source CrossBridge project.  It lets you easily integrate Lua scripts into any ActionScript project (Flash, AIR, etc) with a minimum of headache and zero knowledge of Lua’s C API.

CrossBridge is an amazing piece of technology that unfortunately receives little press.  In summary, it combines GCC with FreeBSD’s libc and allows you to compile C/C++ code to ABC bytecode.  Since ABC is the native bytecode for Adobe Flash and AIR, you end up with a version of Lua that can fully integrate with all of Adobe’s runtimes (mobile, desktop, and web).

The main use case for Easy Lua is to add Lua scripts to ActionScript based games.  I plan on using it to implement card game engines in Lua so that the engine can be used both on the client (single-player mode) and on the server (mutli-player mode).  This will mean less development time, more code reuse, and hopefully fewer bugs.

Totem – Now with services (daemons)

As mentioned in my previous post, Totem is a new Ruby project generator that I’ve put together.  One major missing feature was the ability to easily create services (also known as background processes or daemons).  To solve this problem, I have created an add-on gem called Raad – Totem.  It is a fork of the original Raad gem with a number of customizations to integrate it with a Totem project.  Much thanks go to the original Raad authors since they were able to make it work for both Ruby and JRjuby.

Totem – Ruby Without Rails

Totem is my new Ruby gem for creating Ruby projects without having to depend on Rails.  Some of the features it provides are:

  • Interactive console
  • Logging
  • Standard folder structure (very Rails like)
  • Environments (development, production, etc)
  • Generators
  • Easy database access (via an add-on)

Totem and Totem – Activerecord seek to bring these and many other features to your non-Rails application.  Give it a try and feel free to contact me with your feedback.

Tribe – Futures and Timers

I’ve added a few missing features to Tribe– Timers and Futures.

Timers provide a way to tell an actor to do something in the future.  Tribe supports both one-shot and periodic timers so I believe all the major usage patterns are covered.  Adding this feature was fairly easy since all of the low level details are hidden in my Workers gem.

Futures make it easy for an actor to ask another actor to perform an operation and return the result.  Previously you would have to use custom events and a lot of boilerplate code to accomplish this.  Both synchronous (blocking) and asynchronous (non-blocking) futures are supported.  More information on both types can be found in the readme file.