Skip to content

Instantly share code, notes, and snippets.

@liangzan
Created September 19, 2010 03:35
Show Gist options
  • Select an option

  • Save liangzan/586345 to your computer and use it in GitHub Desktop.

Select an option

Save liangzan/586345 to your computer and use it in GitHub Desktop.
# lib/culerity/celerity_server.rb
def initialize(_in, _out)
...
while(true)
call, block = eval _in.gets.to_s.strip
...
unless call.nil?
begin
result = target(call.first).send call[1], *call[2..-1], &block
_out << "[:return, #{proxify result}]\n"
rescue => e
_out << "[:exception, \"#{e.class.name}\", #{e.message.inspect}, #{e.backtrace.inspect}]\n"
end
end
...
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment