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
2 answers

Building an asynchronous queue in Ruby

I need to process jobs off of a queue within a process, with IO performed asynchronously. That's pretty straightforward. The gotcha is that those jobs can add additional items to the queue. I think I've been fiddling with this problem too long so…
coreyward
  • 77,547
  • 20
  • 137
  • 166
0
votes
2 answers

EventMachine doesn't receive data over datagram socket

I'm using this bit of code to send and receive data, problem is I don't receive anything.. Code: US_HOST = "239.255.255.250" US_PORT = 1900 module SSDP class Client < EventMachine::Connection def receive_data data p "Received some…
Tim Baas
  • 6,035
  • 5
  • 45
  • 72
0
votes
1 answer

Can I use EventMachine in cloud foundry?

When I start a program which uses EventMachine, the vmc start does not return whether it succeed or not. It seems just time out. But,I do see "the server started" in my log file. So I am wondering what is proper way to use EventMachine in cloud…
Kurt Liu
  • 610
  • 2
  • 8
  • 15
0
votes
1 answer

Ruby EventMachine PeriodicTimer chaos

When creating a PeriodicTimer in Ruby EventMachine, it's very inaccurate and seems to act randomly and incorrect. I'm wondering if there is a way to fix that or if I maybe use it in a wrong way. Below is an example. I have a PeriodicTimer that every…
John Meyer
  • 27
  • 1
  • 3
0
votes
1 answer

is it possible to use different sessions in em-http-request multi?

I need to make em-http-request multi request to server with some sessions. Is it possible? I get urls in response with sessionId parameter, it is the same for all requests. But it should be different,…
gayavat
  • 18,910
  • 11
  • 45
  • 55
0
votes
1 answer

VCAP first-time startup issues

Ok, so followed the steps outlined HERE to set up a VCAP instance. I ran it on freshly provisioned Ubuntu 10.04 cloud AMI from Ubuntu DIRECTLY (so its vanilla). After taking FOREVER, i got a success message and promptly tried to start the instance…
Nicholas Terry
  • 1,812
  • 24
  • 40
0
votes
1 answer

Should I be using EM::Synchrony::Multi or EM::Synchrony::FiberIterator with Goliath?

Maybe this is the wrong approach, but I'm trying to parallelize em-hiredis puts and lookups in Goliath with EM::Synchrony::Multi or EM::Synchrony::FiberIterator. However, I can't seem to access basic values initialized in the config. I keep getting…
eywu
  • 2,654
  • 1
  • 22
  • 24
0
votes
1 answer

rails server eventmachine segfault

Performing >rails server yields: C:/Ruby193/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.beta.4.1-x86-mingw32/lib/ eventmachine.rb:179: [BUG] Segmentation fault I have nothing else but google..
Shown
  • 201
  • 1
  • 2
  • 7
0
votes
1 answer

Can EventMachine recognize all threads are completed?

I'm an EM newbie and writing two codes to compare synchronous and asynchronous IO. I'm using Ruby 1.8.7. The example for sync IO is: def pause_then_print(str) sleep 2 puts str end 5.times { |i| pause_then_print(i) } puts "Done" This works as…
philipjkim
  • 3,999
  • 7
  • 35
  • 48
0
votes
1 answer

Handling asynchronous 3rd party http requests in rails

I have the following workflow I am looking for a Rails app: Parse incoming request Construct 3rd party web service request Send 3rd party request Enqueue a worker to process the expected response Process the response once it arrives Send the…
Andrew Lauer Barinov
  • 5,694
  • 10
  • 59
  • 83
0
votes
1 answer

Capistrano remote execution with EventMachine periodic timer

I am using the ruby sprinkle gem (using Capistrano as its deployment mechanism) to execute a command to start a simple ruby app on a remote Ubuntu server. Below is a small snippet of the ruby app code where I think the problem could…
Vic
  • 53
  • 3
0
votes
1 answer

Stop evenmachine after all data loaded with many fibers

I tried get data from rest api using http requests and evenmachine. For this use em-net-http, fibers(ruby1.9.2p290). My pseudocode look like this: EM.run do Fiber.new do api_client.get_data_1 end.resume Fiber.new do …
apopovych
  • 175
  • 1
  • 7
0
votes
2 answers

Ruby and EventMachine-WebSockets - How asynchronous is it?

I'm building a server on Ruby using WebSockets through EventMachine. Let's say user Carl asks for a Car. The car of id "7" is requested to the CarManager. CarManager creates a Car instance, Car loads itself from a Mongo Database (id was provided).…
ArtPulse
  • 365
  • 4
  • 16
0
votes
1 answer

Eventmachine gem permission denied

I'm trying to run $gem install eventmachine -v '0.12.10' because when running $bundle install within my rails app, when it gets to eventmachine I get this error: Installing eventmachine (0.12.10) Errno::EACCES: Permission denied -…
Pippin
  • 1,066
  • 7
  • 15
0
votes
2 answers

can't install eventmachine ruby gem. using RVM, MacOS Lion

I'm using RVM v1.10.2, ruby v1.9.3p0, and ruby gems v1.8.15 on MacOS Lion (kernel v11.4.0). I created a gemset for a rack-based project using sinatra and installed a bunch of gems, including eventmachine (as a result of installing thin). No…
wyattisimo
  • 2,416
  • 2
  • 20
  • 18
1 2 3
41
42