Displaying 20 results from an estimated 2000 matches similar to: "Event loop responsiveness + client"
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
#
2007 Dec 09
38
libevent
Hello,
I have been looking at the Ruby/EventMachine. First let me say it look very
good. Reactor model with no threads makes for fast reliable server, and I
have read about marvelous Twisted framework for Python and am glad to see
something similar for Ruby.
I am writing network app with Ruby threads now and it very slow, and I try
new Ruby 1.9 with native threads that make it much slower.
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 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 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.
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
2006 May 22
3
core-model-2
I''ve added experiments/core-model-2 to SVN. I think this is pretty clean and
satisfactory. Jeff, please have a look and see if you like the placement of
timeouts (which are currently unimplemented). Any event now has the
possibility of a timeout. To get an application-level timeout, you''d just
post an event with a timeout to a nil target. When the timeout expires, the
errback
2008 Apr 30
5
get_peername - start_server vs. connect
Hi,
On windows, get_peername works both with connections obtained
via start_server, and connections obtained via connect.
On linux, get_peername seems to only work with connections
obtained via start_server.
(I''m using svn HEAD.)
I''m wondering which is the intended behavior?
(I realize get_peername is less useful for connections obtained
via connect, since one should already
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
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
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 Jan 29
1
std::runtime_error when calling EM::stop
When I call EM::stop from within a Deferrable callback, I''m getting
the following:
terminate called after throwing an instance of ''std::runtime_error''
what(): already initialized
Abort trap
Is there any way to trace this a little further?
-- Duane Johnson
2007 Dec 14
21
Some silly benchs (was: 1.9)
Guys,
Just for fun, I tried to see (I know, a silly way to test it) how much
overhead we have calling the C functions of the extensions.
the benchmark script and the results:
http://pastie.caboo.se/128646
The naive C extension:
http://pastie.caboo.se/128647
I compared 1.8.6 (VC6 and mingw builds) against a fresh checkout of ruby trunk.
What I understand from that is 1.9 is slower than 1.8
2006 Dec 15
5
Testing event driven Socket classes
Ok, here is the class, I want to Unit Test, its part of a large app
and is based on EventMachine library.
I want to mock the class TickServer ( i.e not stub it) . Since in
actual scenario, you can''t do this on this class:
@server = TickServer.new # will toss an exception at your face
you must initialize the server like this:
EventMachine.run {
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")
2006 Aug 08
11
Core dump using sample DumbHttpClient
I''m using the current release branch from the repository (version_0)
on freebsd 6.1 with ruby 1.8.4. This is the error that is generated
when running the code below at the bottom of the message, plus a gdb
bt. Sorry no debugging symbols built into ruby but maybe the bt will
help anyways.
terminate called after throwing an instance of ''std::runtime_error''
what():
2006 Aug 20
14
http parser
Just thought I''d let you know that your http parser worked great for
creating an http protocol handler for Eventmachine. It wouldn''t take
that much effort to use Eventmachine for Mongrel, might be worth a
shot just to see how it does. A few things would need to be
restructered, like HttpRequest where you read the rest of the body,
and calling the handler. But it
2007 Dec 10
21
BackgrounDRb 1.0 pre-release available now
Hi Folks,
We are glad to announce shiny new release of BackgrounDRb, which will
soon become 1.0.
A quick summary of changes:
- BackgrounDRb is no londer DRb, its based on event driven network
programming library packet ( http://www.packet.googlecode.com ) .
- Since we moved to packet, many nasty thread issues, result hash
corruption issues are totally gone. Lots of work has went in
making
2006 Mar 15
3
softirq bound to vcpus
In "Understanding the Linux Kernel" 3rd edition, section 4.7 "Softirqs and
Tasklets" it states:
"Activation and execution [of defferable functions] are bound together: a
deferrable function that has been activated by a given CPU must be executed on
the same CPU. There is no self-evident reason suggesting that this rule is
beneficial for system performance. Binding the
2007 May 21
13
swifty fly?
I heard about a new mongrel plugin or version that''s single threaded and
uses non-blocking IO with events. It''s called something like "swifty
fly". Anyone have a link for it?
Thanks.