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
316
votes
17 answers

gem eventmachine fatal error: 'openssl/ssl.h' file not found

Just installed El Capitan and can't install gem eventmachine 1.0.7. openssl is at 1.0.2a-1. Tried to use --with-ssl-dir but it seems ignored. Reported it to their github repo as well. Any suggestions are really appreciated. Thanks. $ ls…
firedev
  • 20,898
  • 20
  • 64
  • 94
72
votes
3 answers

What is the difference between event driven model and reactor pattern?

From the wikipedia Reactor Pattern article: The reactor design pattern is an event handling pattern for handling service requests delivered concurrently to a service handler by one or more inputs. It named a few examples, e.g. nodejs, twisted,…
Howard
  • 19,215
  • 35
  • 112
  • 184
37
votes
5 answers

Any success with Sinatra working together with EventMachine WebSockets?

I have been using Sinatra for sometime now and I would like to add some realtime features to my web-app by pushing the data via websockets. I have successfully used the gem 'em-websocket' on its own, but have not been able to write one ruby file…
Poul
  • 3,426
  • 5
  • 37
  • 43
34
votes
6 answers

EventMachine: "`start_tcp_server': no acceptor (port is in use or requires root privileges)"

When I try and run the server with EventMachine::run I keep getting the error saying that the port is in use. This started ever since I ran the server in the background with the command nohup. I am pretty sure I have killed the process I started: I…
Will Sewell
  • 2,593
  • 2
  • 20
  • 39
32
votes
9 answers

Eventmachine gem install fail

I am not able to install eventmachine Ok I know this has been asked quite a lot, but no solutions I found has helped me so far.So I posted here as a last resort. I use windows 8 x64 using ruby 2.0.0p195 (x64) (installed throught Ruby Installer for…
Vasspilka
  • 1,135
  • 1
  • 10
  • 22
30
votes
5 answers

EventMachine vs Node.js

I'm going to develop a collaborative site, and one of the features will be collaborative editing with realtime changes. i.e. when two or more users are editing the same doc, they can see each other changes as soon as they happen. I have some…
Pablo B.
  • 1,823
  • 1
  • 17
  • 27
29
votes
2 answers

How do EventMachine & Rails integrate?

I've found plenty of articles showing me what EventMachine is and how to set up endless "Hello World!" examples, but I'm still at a loss as to how this integrates with my Rails application. As a example, I have an existing Rails app that has many…
neezer
  • 19,720
  • 33
  • 121
  • 220
28
votes
8 answers

Error installing EventMachine gem on OSX Yosemite

Here is the full output of the error message: Fetching: eventmachine-1.0.3.gem (100%) Building native extensions. This could take a while... ERROR: Error installing eventmachine: ERROR: Failed to build gem native extension. …
tgmerritt
  • 714
  • 1
  • 7
  • 16
26
votes
3 answers

What is the point/purpose of Ruby EventMachine, Python Twisted, or JavaScript Node.js?

I don't understand what problem these frameworks solve. Are they replacements for a HTTP server like Apache HTTPD, Tomcat, Mongrel, etc? Or are they more? Why might I use them... some real world examples? I've seen endless examples of chat rooms…
CCw
  • 271
  • 3
  • 3
21
votes
8 answers

How do you spawn an EventMachine "inside" a Rails app?

I've got a Rails application, and am looking to add some sort of WebSocket support to it. From various googling, it appears that the best Ruby based WebSocket solution is em-websocket running on EventMachine. I was wondering if there was a way to…
Mike Trpcic
  • 25,305
  • 8
  • 78
  • 114
17
votes
3 answers

Could not bundle install because of 'eventmachine 1.0.3'

$ bundle install Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/Sean/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/eventmachine-1.0.3/ext/gem_make.out An error occurred while installing eventmachine (1.0.3), and Bundler…
Shion Yamaguchi
  • 601
  • 2
  • 8
  • 16
16
votes
2 answers

Rails how to parse text/event-stream?

I have an API url that is a stream of data with the content type: text/event-stream. How is it possible to listen to the stream? Like subsribe to each event to print the data? I have tried to use the ruby libary em-eventsource My test.rb…
Rails beginner
  • 14,321
  • 35
  • 137
  • 257
15
votes
2 answers

Does EventMachine issue close_notify on close_connection if tls_start was run?

I am trying to program a simple FTPS server based on EventMachine. Control socket works properly. When using data socket for data transfer, it seems that everything works well (TLS handshake completes successfully and data is received), but then I…
Pavel K.
  • 6,697
  • 8
  • 49
  • 80
13
votes
1 answer

Ruby concurrency: non-blocking I/O vs threads

I am playing around with concurrency in Ruby (1.9.3-p0), and have created a very simple, I/O-heavy proxy task. First, I tried the non-blocking approach: require 'rack' require 'rack/fiber_pool' require 'em-http' require 'em-synchrony' require…
BSM
  • 159
  • 1
  • 6
13
votes
2 answers

Why is an event loop needed for Asynchronous I/O

I've done lots of development in C#/.Net, and the asynchronous story has always been there from day one (admittedly the API's have changed significantly over the years from begin/end to events, to Task with async/await). For the last year or so…
BFree
  • 102,548
  • 21
  • 159
  • 201
1
2 3
41 42