Skip to content

Instantly share code, notes, and snippets.

@matschaffer
Forked from anonymous/hystrix_example.rb
Last active December 17, 2015 08:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save matschaffer/5579702 to your computer and use it in GitHub Desktop.
Save matschaffer/5579702 to your computer and use it in GitHub Desktop.
#!/usr/bin/env jruby
require 'rubygems'
require 'jbundler'
require 'java'
java_import com.netflix.hystrix.HystrixCommand
java_import com.netflix.hystrix.HystrixCommandGroupKey
class TestCommand < HystrixCommand
def initialize(name)
super(HystrixCommandGroupKey::Factory.asKey("ExampleGroup"))
@name = name
end
def run
"Hello #{@name}!"
end
end
puts TestCommand.new("mat").execute
exit(0)
jar 'com.netflix.hystrix:hystrix-core', '~>1.2.16'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment