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 check if EventMachine::Connection is open?

I have a handle to a Connection object in Event Machine: http://eventmachine.rubyforge.org/EventMachine/Connection.html How can I check if the connection is open or closed at any point of time? I don't see any method specified in the API.
Kowshik
  • 1,541
  • 3
  • 17
  • 25
0
votes
1 answer

Recursive queue results in "stack level too deep"

I'm trying to get this code to work using em-synchrony 1.0.1. require "em-synchrony" class Worker attr_reader :station_queue, :list def initialize @station_queue = EM::Queue.new @list = ["value"] * 100 end def run! …
Linus Oleander
  • 17,746
  • 15
  • 69
  • 102
0
votes
1 answer

EventMachine on Heroku with Rails & EM-C2DM Gem

Trying to use the GroupMe gem EM-C2DM, https://github.com/groupme/em-c2dm, a Google C2DM Ruby Library using Event Machine, within Rails. I know it should work on Heroku as there is a configuration specific to Heroku, however I can't seem to get it…
Scott Feinberg
  • 574
  • 4
  • 20
0
votes
1 answer

Ruby 1.9.2 eventmachine installation error on Snow Leopard

When I'm trying to install eventmachine on my OSX I got this error. Building native extensions. This could take a while... ERROR: Error installing eventmachine: ERROR: Failed to build gem native extension. …
toy
  • 11,711
  • 24
  • 93
  • 176
0
votes
1 answer

Is it ok to have a `SendEmail` rack middleware or other such background job middlewares?

I read rack middleware is for modifying the current request/response, but what about having a SendEmail middlewares which would look at env['user_id'] to send emails. Let's assume the entire process (request + sending emails) will be async.
sent-hil
  • 18,635
  • 16
  • 56
  • 74
0
votes
1 answer

Redirect internally within Goliath endpoints

require 'goliath' require 'em-synchrony' require 'em-synchrony/em-http' class UsersSendEmail < Goliath::API use Goliath::Rack::Params def response(env) [200, {}, {response: 'email sent'}] end end class UsersCreate < Goliath::API use…
sent-hil
  • 18,635
  • 16
  • 56
  • 74
0
votes
2 answers

How to test em-mongo + Goliath?

This below app saves some data to the db and I want to test that it saves properly. require 'goliath' class App < Goliath::API def response(env) db = EM::Mongo::Connection.new('localhost').db('hello') …
sent-hil
  • 18,635
  • 16
  • 56
  • 74
0
votes
2 answers

Thin Gem Won't Work on Heroku

I'm moving from the Bamboo stack to the Cedar one on Heroku, but I'm running into issues trying to run the Thin gem on Heroku. Locally, I'm running Windows Vista, but I have the same error mentioned in the comments here, When I add the Thin gem to…
yellowreign
  • 3,528
  • 8
  • 43
  • 80
0
votes
1 answer

EventMachine and some Ruby syntax

I'm trying to get a better understanding of the following lines of code involving EventMachine. Trying to learn Ruby the hard way. What does EventMachine.run does in this code? What does |chunk| means in this case? Also, what does 'while line'…
fokusfocus
  • 195
  • 1
  • 3
  • 15
0
votes
1 answer

Rails non-blocking post

I need to POST to another server rather frequently in my Rails app, but it takes foreeever. The catch is that I don't need the response. Is there any way to speed things up by sending the request and then dropping the connection without waiting for…
JRPete
  • 3,074
  • 3
  • 19
  • 17
-1
votes
2 answers

Thin/eventmachine non-root installation problem

Trying to run ruby on rails framework under nginx+thin, currently working under WEBrick. I don't have root access, cause it is hosted at web hosting service. Till this moment all problems with gems solved w/o root access. thin requires eventmachine,…
-1
votes
2 answers

Get data from an EventMachine server connection?

I'm attempting to create a Sinatra server that will return statistics about an EventMachine server. That is, I'm running: EventMachine.run do server = EventMachine.start_server 'localhost', 3333, MyApp dispatch = Rack::Builder.app do …
josh
  • 9,656
  • 4
  • 34
  • 51
1 2 3
41
42