Questions tagged [eventmachine]

EventMachine is a fast, reactor pattern library for Ruby programs. It provides non-blocking IO APIs with transparent internal buffers and standard reactor features (such as defer, next_tick and timers). (note to future editors: Eventmachine itself does not use Fibers, and the core does not use threads for any IO, timers or core infrastructure).

EventMachine is a fast, reactor pattern library for Ruby programs.

627 questions
0
votes
1 answer

How to enable high performance http client which is based on faraday and event machine synchrony?

I'm refactoring a ROR project which is using Faraday as request client and has predefined adapter to use with EM synchrony like this: def which_faraday_adapter? if Utils::ModuleLoaded.synchrony? && Utils::ModuleLoaded.fiberpool? …
harryz
  • 4,980
  • 6
  • 31
  • 34
0
votes
2 answers

Task with EventMachine service

I need to resolve this task. I need to develop a service, which delivers HTTP GET requests with guarantee using EventMachine. Service has API /send? url=http%3A%2F%2Fya.ru, where url it is http request which is need to be delivered/ On every…
Andrey
  • 191
  • 2
  • 6
0
votes
1 answer

Missing linux/types.h failing to install gem

I'm getting an error trying to install eventmachine on my ubuntu 12.04 server. Any ideas? bundle exec gem install eventmachine Building native extensions. This could take a while... ERROR: Error installing eventmachine: ERROR: Failed to build…
Mark Robinson
  • 1,479
  • 2
  • 15
  • 34
0
votes
1 answer

amqp not taking config hash provided

I tried to start amqp with the correct amqp credential but it fails. I have started rabbitmq server at port 5678 and I am using amqp gem of version 0.7.0 and I am using ruby-1.9.2 Here are the logs for what I have done in irb ±…
Gagan
  • 4,278
  • 7
  • 46
  • 71
0
votes
1 answer

How can I use EventMachine from within a Sinatra app?

I use an api, that is written on top of EM. This means that to make a call, I need to write something like the following: EventMachine.run do api.query do |result| # Do stuff with result end EventMachine.stop end Works fine. But now I…
troelskn
  • 115,121
  • 27
  • 131
  • 155
0
votes
2 answers

Wrong Ruby Interpreter being used

I'm trying to setup Apache/Thin to power my Rails 3.2.9 application, which means setting up both Apache and Thin as daemons. I'm using RVM/gemset that runs Ruby 1.9.3-p286, however, my daemons don't seem to want to use it, instead, opting for some…
David Elner
  • 5,091
  • 6
  • 33
  • 49
0
votes
1 answer

SIP TCP/IP Socket with Ruby, Thin and EventMachine

I'm very new to sockets and SIP but I want to create an SIP application, I'm sure I have enough programming experience, but I just need a push forward to get started. The problem is I don't get response from a socket, and I just don't know how to…
Tim Baas
  • 6,035
  • 5
  • 45
  • 72
0
votes
2 answers

Consume Table using EventMachine

I have a model Resend in my Ruby project, it contains content and status columns. What is the best/fastest way to consume all the records with status 0 using EventMachine ? I want to create a simple worker that try to find records with status==0…
Eki Eqbal
  • 5,779
  • 9
  • 47
  • 81
0
votes
2 answers

Why isn't unicorn+mysql2 gem showing latest version of model data on multi-worker prod setup?

My model doesn't seem to be updated correctly. Unicorn rainbows! on EventMachine mysql2 gem I can reproduce in the production environment with 1000 rpm on 8 workers. If I update my_model in the Rails console (with a call to reload!), all works…
gayavat
  • 18,910
  • 11
  • 45
  • 55
0
votes
1 answer

Return Sinatra response before stopping EventMachine

I'm using Sinatra within event-machine, and I want to shut down the server and exit upon receiving a DELETE request, and return a 200 OK. However, right now I can't get to that point, and always end u returning an empty response before exiting. How…
Suan
  • 34,563
  • 13
  • 47
  • 61
0
votes
1 answer

how to use EM::Synchrony::Multi with redis?

I am trying to perform several redis queries in parallel, but getting an error: /var/lib/gems/1.9.1/gems/em-synchrony-1.0.2/lib/em-synchrony.rb:53:in `resume': dead fiber called (FiberError) here is the code: require 'em-synchrony' require…
akonsu
  • 28,824
  • 33
  • 119
  • 194
0
votes
1 answer

ruby eventmachine http-request deferrable

That's my first time with EM so I really need some help here so here's the code: EM.run do queue = EM::Queue.new EM.start_server('0.0.0.0', '9000', RequestHandler, queue) puts 'Server started on localhost:9000' # Any interface, actually …
Vlad Khomich
  • 5,820
  • 1
  • 27
  • 39
0
votes
1 answer

Ruby eventmachine and WIN32OLE

I'm trying to use the WIN32OLE class in conjunction with the eventmachine library. The OLE library communicates fine with the program, but the minute I add the WIN32OLE_Event hook to the program, it doesn't. The events fire at unpredictable times…
Supy
  • 180
  • 2
  • 10
0
votes
2 answers

Practices for controlling a Ruby application "from the outside"

So, I have a long-running Ruby process, that does a wide variety of things, depending on what's it told to do (EventMachine TCP server with binary messages). Now, I would like to give certain people the ability to monitor, change, shut down the…
omninonsense
  • 6,644
  • 9
  • 45
  • 66
0
votes
1 answer

Sending outside of EventMachine loop

I'm using the em-ws-client gem, although I think my question is more general than that. I'm trying to send data from outside the EventMachine receive block, but it takes a very long time (~20s) for the data to be sent: require "em-ws-client" m =…
lucas clemente
  • 6,255
  • 8
  • 41
  • 61