This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'amqp' | |
class Client | |
def initialize | |
@config = { | |
:host => 'localhost' | |
} | |
end | |
def request(api, msg, reply_to) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'amqp' | |
def run | |
config = { | |
:host => 'localhost' | |
} | |
AMQP.start(config) do |connection| | |
channel = AMQP::Channel.new(connection) | |
queue = channel.queue('', :auto_delete => true) | |
exchange = channel.direct 'ex.direct' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.util.parsing.combinator._ | |
abstract class Value { | |
def eval():Double | |
} | |
case class Number(n:Double) extends Value { | |
def eval():Double = n | |
} | |
case class Binomial(op: String, v1:Value, v2:Value) extends Value { | |
def eval():Double = op match { |