# Event framework?

**URL:** <https://www.ruby-forum.com/t/event-framework/89019>\
**Category:** Ruby\
**Created:** [January 3, 2006, 8:39pm UTC](https://www.ruby-forum.com/t/event-framework/89019 "2006-01-03T20:39:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![markthomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Post date:** [January 3, 2006, 8:39pm UTC](https://www.ruby-forum.com/t/event-framework/89019/1 "2006-01-03T20:39:44Z")

</div>

I dabble in home automation and am looking for a framework that would  
allow me to monitor and react to serial port events. I’m a long-time  
Perl user and if anyone is familiar with POE, that’s the type of  
framework I’m looking for (an Inversion-of-Control framework where I  
have agents running in separate threads monitoring serial ports,  
triggering events in the main code). I’ve perused RAA and seen a few  
possibilities, but don’t see anything recently maintained. Is there a  
good match for the type of thing I’m looking to do?

There are several new home automation technologies available now and  
they don’t yet have serial drivers, so I figure it would be a good time  
to attempt the switch to Ruby. Besides, I’m moving to Ruby, VA next  
month, so I figure I’d better start learning the language! 🙂

- Mark.

---

<div class="post-metadata">

**Author:** ![markthomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Post date:** [January 3, 2006, 9:06pm UTC](https://www.ruby-forum.com/t/event-framework/89019/2 "2006-01-03T21:06:26Z")

</div>

Mark T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> they don’t yet have serial drivers, so I figure it would be a good  
> time to attempt the switch to Ruby. Besides, I’m moving to Ruby, VA  
> next month, so I figure I’d better start learning the language! 🙂
> 
> - Mark.

IIRC there was a discussion about this recently. You might find it by  
searching the archives at  
[http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml](http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml)

Kind regards

```
robert

```

---

<div class="post-metadata">

**Author:** ![markthomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Post date:** [January 3, 2006, 10:15pm UTC](https://www.ruby-forum.com/t/event-framework/89019/3 "2006-01-03T22:15:17Z")

</div>

Robert K. wrote:

> > There are several new home automation technologies available now and  
> > they don’t yet have serial drivers, so I figure it would be a good  
> > time to attempt the switch to Ruby. Besides, I’m moving to Ruby, VA  
> > next month, so I figure I’d better start learning the language! 🙂
> > 
> > - Mark.
> 
> IIRC there was a discussion about this recently. You might find it by  
> searching the archives at  
> [http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml](http://blade.nagaokaut.ac.jp/ruby/ruby-talk/index.shtml)

> From this, I have gleaned the following:

- Ruby/Event is now dead.
- IO::Reactor has been stuck at 0.0.6 since 2003 (effectively dead)
- event-loop looks promising.
- there are a few others, mostly in alpha stages, that focus on file  
descriptors
- I have asked a similar question before (Sorry, forgot!) but  
event-loop wasn’t announced at that time.

I think I’ll try out event-loop.

Thanks,

- Mark.

---

<div class="post-metadata">

**Author:** ![markthomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Post date:** [January 4, 2006, 6:14pm UTC](https://www.ruby-forum.com/t/event-framework/89019/4 "2006-01-04T18:14:36Z")

</div>

Yes, I considered Twisted. But it evidently has a VERY steep learning  
curve; many experienced Python people are put off by it. If I had to  
resort to a non-Ruby solution I’d use POE, but really I’d like to find  
a Ruby solution.

Thanks,

- Mark.

---

<div class="post-metadata">

**Author:** ![markthomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Post date:** [January 4, 2006, 12:18pm UTC](https://www.ruby-forum.com/t/event-framework/89019/5 "2006-01-04T12:18:45Z")

</div>

Il 2006-01-03, Mark T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) ha scritto:

> they don’t yet have serial drivers, so I figure it would be a good time  
> to attempt the switch to Ruby. Besides, I’m moving to Ruby, VA next  
> month, so I figure I’d better start learning the language! 🙂

If you don’t complain about the language Python community has Twisted  
Matrix

- [http://www.twistedmatrix.com](http://www.twistedmatrix.com) - that seems just what are you looking  
for.

---

<div class="post-metadata">

**Author:** ![markthomas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90db22/32.png) [@markthomas](https://www.ruby-forum.com/u/markthomas)\
**Post date:** [January 4, 2006, 6:50pm UTC](https://www.ruby-forum.com/t/event-framework/89019/6 "2006-01-04T18:50:57Z")

</div>

Mark T. wrote:

> Yes, I considered Twisted. But it evidently has a VERY steep learning  
> curve; many experienced Python people are put off by it. If I had to  
> resort to a non-Ruby solution I’d use POE, but really I’d like to find  
> a Ruby solution.
> 
> Thanks,
> 
> - Mark.

There’s another wa;y to register callbacks etc which i haven’t tried  
[http://phrogz.net/RubyLibs/rdoc/classes/EventTarget.html](http://phrogz.net/RubyLibs/rdoc/classes/EventTarget.html)

also, have you looked at the new Oreilly Twisted book. It has a nice  
cookbook-y feel to setting up clients and servers for existing  
protocols, rather than rolling your own, altho Amazon review noted it’s  
a slim book and testing gets short shrift.
