Displaying 20 results from an estimated 3000 matches similar to: "EventMachine::run - How can I ensure that this"
2008 Apr 23
2
Status of EventMachine.fork
Hi All,
I''m currently looking into doing a bit of evented network programming
in ruby and i''m currently looking into packet, eventmachine and rev.
The problem is that I need to be able to fork and start a new reactor
within the forked child (it also should open a socket and write
status information back to the main process). I have not been able to
do this with EventMachine.
2008 Aug 22
6
EventMachine website down?
Hi all
Is the EventMachine website (www.rubyeventmachine.com) down? I can''t access
it from South Africa, and have tried using tor as well with no luck.
I''m kinda new to EventMachine, so I first have a lot of examples to work
through and reading to do before I start pestering the mailing list with
questions.
Thanks to everyone who partook in creating the library, so far
2008 Jan 14
10
Using EventMachine to listen from non-network
I''ve actually found a way to make EventMachine listen to events from a
serial port, but only by using the pure Ruby version, using Guilliame
Pierronnet''s Ruby/SerialPort library. It turned out to be simpler
than I thought it would be:
require ''serialport''
$eventmachine_library = :pure_ruby
require ''eventmachine''
module EventMachine
class
2009 Mar 15
2
How can I add TimeoutHandler to EvenmentMachine
Hi, list
Now I am coding for one non-blocking httpclient based on event-machine, and
it seems the client will hang for 50 seconds if the destination is
unreachable. My questions are
1. How can I short the timeout? I had tried
conn.set_comm_inactivity_timeout(5), but it didn''t work
2. How can I add TimeoutHandler to the connection?
Thanks!
/Jack
--
Jack Tang
Software
2007 Feb 25
6
Crash occurs where EventMachine.connect is
Hi everyone,
If you subclass EventMachine::Connection and call it outside an
EventMachine::run
event loop, EventMachine crashes! Example:
class Put < EventMachine::Connection
include EventMachine::Deferrable
HOST="localhost"
PORT=8080
def self.request(data)
EventMachine.connect(HOST, PORT, self) {|c|
c.instance_eval { @data = data }
}
end
#
2008 Mar 18
1
Eventmachine utils
I''m working on StrokeDB* right now and put pieces of networking stuff
into a separate repository "Eventmachine utils". There are 3 useful
libs already: protocol chaining, messaging protocol and marshalled
messaging protocol. Check them out :-)
Overview:
http://gitorious.org/projects/eventmachine-utils
Files:
2007 Nov 07
4
Gracefully stopping EventMachine?
Hello all,
I''ve been learning Ruby and playing with a chat server I built using
GServer. After into an issue I found with GServer, that no one else seemed
to notice (actually, similar to this question, GServer is hard to kill
nicely, especially when you want to.), I found references to EventMachine,
and rebuilt my server using it. I much prefer EventMachine''s model.
The
2008 Oct 23
3
ANN: EMDRb 0.1.0
I am pleased to announce the release of EMDRb version 0.1.0, a
rudimentary implementation of a distributed Ruby server based on
EventMachine. It''s available on Rubyforge at
http://rubyforge.org/projects/emdrb but I must admit that it has thus
far only been lightly tested and still a bit feature incomplete. The
server implementation can already do all of the basic stuff one expects
DRb
2007 May 24
4
Multiple EM connections on separate threads
Hi EM Gurus,
I''m hoping someone can shed some light on the following...
I''m using a 3rd party (legacy) server that can accept up to 8
simultaneous connections on one port.
I''ve been able to make multiple connections to this server from within
one call to EventMachine::run {...}.
Specificaly, I can access each connection separately using:
em_thread = Thread.new do
2011 Sep 26
2
undefined method `options' for #<EventMachine::HttpClien
Hi , I am writing a rake task to consume twitter stream API. The task
contains the following code:
consumer = OAuth::Consumer.new(CONSUMER_KEY, CONSUMER_SECRET, :site =>
''http://twitter.com'')
access_token =
OAuth::AccessToken.new(consumer,ACCESS_TOKEN,ACCESS_TOKEN_SECRET)
oauth_params = {:consumer => consumer, :token => access_token}
EventMachine.run do
# now,
2008 Feb 07
6
Buffer flushing
Short question: is there way to tell EM to actually send data after
send_data call?
I''m building a file transferring app. I send Mashal.dump''ed metadata
first, and then - the file contents (chunked). I found a silly bug:
receive_data() gets marshalled metadata and the first chunk of the
file in a single variable.
Like that:
c1.send_data("meta")
2007 Sep 14
3
epoll appears to break
The following program is a minor variant on the sample given in the README
with eventmachine-0.8.1. I am running under CentOS 4.5 (kernel
2.6.9-55.0.2.plus.c4) with a ruby-1.8.5 RPM from the CentOS testing
repository.
When I run it, I find that set_comm_inactivity_timeout doesn''t do anything.
That is, if I client opens a connection, it stays open indefinitely.
However, if I comment out
2008 Jan 06
5
Having very odd problems with UDP.
I am using eventmachine 0.8.1 on windows XP and am having very odd problems.
This snippet of code gives the error that follows it.
class EchoServer
def receive_data data
puts data
send_data ">>>you sent: #{data}"
if data =~ /quit/i
puts "quitting"
close_connection
EventMachine::stop_event_loop
end
end
end
2008 Aug 06
6
Event loop responsiveness + client
Hello, on the application that I''m working on, we are using Thin.
The server implements long polling and commands that alter its internal state.
Connecting to the long poll is a very fast operation, while updating
the state of the server is a relatively slow operation.
The long poll connection is held open until there is a change to be
sent to the connection.
Here is my current
2009 Mar 12
1
Rspec and EventMachine
Hey Guys,
I am trying to create a app that makes use of EventMachine.
As I recently fell in love with Rspec, I was trying to use it with our
EM. However, I have no idea how to do this. Also, I want to remove
network connections from the tests (as I might not be connected when
running them), so I think I should mock them up, but again... I don''t
know how to do this!
Any tips?
Thanks
2009 Feb 26
1
0.12.4 dies with call SetTlsParms before
I upgraded from 12.2 to 12.4 and found that my happy little eventmachine
processes die with:
terminate called after throwing an instance of ''std::runtime_error''
what(): call SetTlsParms before calling StartTls
Here''s what I believe is the relevant snippet of my code, which calls
start_tls() in the connection_completed() callback:
connection =
2007 Aug 15
2
Interfaces for accessing SSL/TLS certificates
Hi everyone. Does anyone have any preferences or ideas for an interface for
SSL certificates, both client-side and server-side? At present, the only
interface is EventMachine::Connection#start_tls, which uses a built-in
self-signed cert on the server side. On the cilent side, it accepts any
well-formed cert (that is, it doesn''t check that the remote cert is signed
by a trusted authority).
2006 Nov 03
6
How to send data,
Hello,
First of all I''m new to working with sockets,
so the problems I''m having are probably because of my lack of understanding.
What I''m trying to accomplish is to create a mac os x client gui to ruby-debug.
When a application that includes ruby-debug is started,
it starts listening for 2 connections; 8989, 8990
The connection is made by calling the connectToApp
2008 Feb 01
6
epoll increasing latency big time
Sorry this is going to be a bit vague, but I''ve noticed something rather odd
going on with EventMachine on Linux.
I''ve written something uses EventMachine to proxy HTTP to other processes.
On OS X, it works great, adding only about 20% extra latency into the
connection when proxying versus connecting to the original backend process
directly, so a 5ms connection might now take
2009 Feb 11
0
Eventmachine ssl
This has been fixed in master branch on Github. Francis implemented a new
event that calls #ssl_handshake_completed on the Connection, and I wrote
#get_peer_cert that can be called after/inside of #ssl_handshake_completed.
It returns the remote peer''s certificate as a String in PEM format. These
methods are documented in the code.
--
Jake Douglas
206-795-9207
-------------- next part