S
snacktime
Is there an event driven framework for ruby? Something similar to POE
in perl or twisted in python?
Chris
in perl or twisted in python?
Chris
Actually, yes. I'm working on the Ruby/Event library. It's a C
extension
for libevent. I built a small framework on top of this called Myriad
which is similar to twisted and POE. I used Myriad to write the SCGI
client/server which can host Ruby on Rails applications.
James Edward Gray II said:Does this do all it's socket work in C, to bypass Ruby's Thread
blocking issues?
What blocking issue?
James Edward Gray II said:Writing a large chunk of data to a file, for example. Ruby will
block until the write completes.
Disk I/O will always block the process executing it. only way to avoid
that is to have another process do the disk I/O (at least on linux,
*bsd; there used to have a unix that does not have this limitation,
but i can't remember the name). Using native thread also does not help
since the whole process is blocked.
James Edward Gray II said:Non-blocking IO is another solution.
James Edward Gray II
Additionally, Myriad is layered on top of the libevent bufferevent
structure, so libevent actually does *all* of the IO and we just
have to
read chunks of memory data. This gets around a ton of performance
bottle-necks and interference from Ruby Sockets.
I'll hopefully have a more detailed explanation when I release
later this
week.
snacktime said:Is there an event driven framework for ruby? Something similar to POE
in perl or twisted in python?
James Edward Gray II said:Non-blocking IO is another solution.
Tanaka said:O_NONBLOCK is not always applicable.
* read from socket: works well by default. (O_NONBLOCK is not required.)
(UDP packet with wrong checksum on Linux 2.6 is an exception.)
* read from socket: works well by default. (O_NONBLOCK is not required.)
(UDP packet with wrong checksum on Linux 2.6 is an exception.)
Yohanes Santoso said:Disk I/O will always block the process executing it. only way to avoid
that is to have another process do the disk I/O (at least on linux,
*bsd; there used to have a unix that does not have this limitation,
but i can't remember the name). Using native thread also does not help
since the whole process is blocked.
Tanaka said:Can you say a bit more about what happens differently on Linux 2.6 when
a UDP packet has a bad checksum? Is it a ruby behavior or a linux behavior?
(I'm working with wireless UDP on linux 2.6, having migrated from QNX,
so it sounds important to me...)
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.