Common library among www.iron.io Ruby clients.
iron-io / iron_core_ruby Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 2-Clause "Simplified" License
License: BSD 2-Clause "Simplified" License
Common library among www.iron.io Ruby clients.
from inside a rails app, i do
IronMQ::Client.new.queue 'hello'
i get
/home/vagrant/.rvm/gems/ruby-2.1.2/gems/iron_core-1.0.3/lib/iron_core/client.rb:114:in `expand_path': non-absolute home (ArgumentError)
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/iron_core-1.0.3/lib/iron_core/client.rb:114:in `load_from_config'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/iron_core-1.0.3/lib/iron_core/client.rb:60:in `block (3 levels) in initialize'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/iron_core-1.0.3/lib/iron_core/client.rb:55:in `each'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/iron_core-1.0.3/lib/iron_core/client.rb:55:in `block (2 levels) in initialize'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/iron_core-1.0.3/lib/iron_core/client.rb:54:in `each'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/iron_core-1.0.3/lib/iron_core/client.rb:54:in `block in initialize'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/iron_core-1.0.3/lib/iron_core/client.rb:53:in `each'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/iron_core-1.0.3/lib/iron_core/client.rb:53:in `initialize'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/iron_mq-5.0.1/lib/iron_mq/client.rb:21:in `initialize'
from /vagrant/leo/app/workers/message_puller.rb:7:in `new'
from /vagrant/leo/app/workers/message_puller.rb:7:in `initialize'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/runner.rb:62:in `new'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/runner.rb:62:in `<top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/runner.rb:62:in `eval'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/runner.rb:62:in `<top (required)>'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:128:in `require'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:128:in `require_command!'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:95:in `runner'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /home/vagrant/.rvm/gems/ruby-2.1.2/gems/railties-4.1.1/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
Is there a way to flush the cache or delete all keys?
I ran into an issue where the get command was returning duplicates. I have a simple threaded app that reads from the queue and processes items.
The problem seems to be that if multiple threads request the same url from typheous before a response comes back it only makes one request and returns the response to all the requesting threads.
I was able to get around this by attaching a random value to the request params which will make each URL unique.
IronMQ::Client.new(...).queue(...).get(unique_name: SecureRandom.hex)
It might be nice to note in your readme that this behavior exists.
Can you explain why you use gem rest
?
It's depend at rest_client
but common use is rest-client
and their conflict at binary, both has executable restclient
?
Thanks
def put(method, params={})
request_hash = {}
request_hash[:headers] = common_request_hash
request_hash[:body] = params.to_json
IronCore::Logger.debug 'IronCore', "PUT #{url + method} with params='#{request_hash.to_s}'"
@rest.put(url + method, request_hash)
end
Any 2xx response should probably be acceptable. This affects iron_cache_ruby when performing an add when there is an existing item.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.