Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [ANN] rev 0.3.0: Now with filesystem monitoring

Reply
Thread Tools

[ANN] rev 0.3.0: Now with filesystem monitoring

 
 
Tony Arcieri
Guest
Posts: n/a
 
      08-29-2009
[Note: parts of this message were removed to make it a legal post.]

Rev is a high-performance event library for Ruby, providing event loops for
monitoring network, timer, and now filesystem events. Rev is based on the
libev C library.

http://github.com/tarcieri/rev/

Rev 0.3.0 provides some bugfixes and performance improvements as well as a
slew of new features, including many new extensions to existing APIs that
provide for better integration with the Ruby environment, and a new
filesystem monitoring API built on the facilities provided by the libev
event library, including inotify support on Linux.

The new StatWatcher API allows you to monitor any file or directory for
changes and receive events when changes occur:

-- snip --

class MyStatWatcher < Rev::StatWatcher
def on_change
begin
puts "#{path} has new status #{File.stat(path).inspect}"
rescue Errno::ENOENT
puts "#{path} was deleted"
end
end
end

watcher = MyStatWatcher.new "interesting/file"
watcher.attach Rev::Loop.default
Rev::Loop.default.run

-- snip --

I know there are many gems already available to provide filesystem
monitoring, such as directory_watcher (
http://github.com/TwP/directory_watcher/tree/master), and that EventMachine
already provides EM.watch_file, but for the Rev users out there, you now
have the same capabilities with Rev's asynchronous event loops.

--
Tony Arcieri
Medioh/Nagravision

 
Reply With Quote
 
 
 
 
Tim Pease
Guest
Posts: n/a
 
      08-29-2009
On Sat, Aug 29, 2009 at 12:12 AM, Tony Arcieri<> wrote:
> Rev is a high-performance event library for Ruby, providing event loops f=

or
> monitoring network, timer, and now filesystem events. =A0Rev is based on =

the
> libev C library.
>
> http://github.com/tarcieri/rev/
>
> Rev 0.3.0 provides some bugfixes and performance improvements as well as =

a
> slew of new features, including many new extensions to existing APIs that
> provide for better integration with the Ruby environment, and a new
> filesystem monitoring API built on the facilities provided by the libev
> event library, including inotify support on Linux.
>


Awesome work Tony!

I for one welcome our new event-loop driven file notification
overlords. Thanks for adding inotify support in an elegant manner.

Blessings,
TwP

 
Reply With Quote
 
 
 
 
Rob Sanheim
Guest
Posts: n/a
 
      08-31-2009
[Note: parts of this message were removed to make it a legal post.]

On Sat, Aug 29, 2009 at 2:12 AM, Tony Arcieri <> wrote:

> Rev is a high-performance event library for Ruby, providing event loops for
> monitoring network, timer, and now filesystem events. Rev is based on the
> libev C library.
>
> http://github.com/tarcieri/rev/
>
> Rev 0.3.0 provides some bugfixes and performance improvements as well as a
> slew of new features, including many new extensions to existing APIs that
> provide for better integration with the Ruby environment, and a new
> filesystem monitoring API built on the facilities provided by the libev
> event library, including inotify support on Linux.
>
> The new StatWatcher API allows you to monitor any file or directory for
> changes and receive events when changes occur:
>
> -- snip --
>
> class MyStatWatcher < Rev::StatWatcher
> def on_change
> begin
> puts "#{path} has new status #{File.stat(path).inspect}"
> rescue Errno::ENOENT
> puts "#{path} was deleted"
> end
> end
> end
>
> watcher = MyStatWatcher.new "interesting/file"
> watcher.attach Rev::Loop.default
> Rev::Loop.default.run
>
> -- snip --
>
> I know there are many gems already available to provide filesystem
> monitoring, such as directory_watcher (
> http://github.com/TwP/directory_watcher/tree/master), and that
> EventMachine
> already provides EM.watch_file, but for the Rev users out there, you now
> have the same capabilities with Rev's asynchronous event loops.
>
> --
> Tony Arcieri
> Medioh/Nagravision
>


Hi Tony

Does this use fsevents on Mac OSX?

Thanks,
Rob

 
Reply With Quote
 
Tony Arcieri
Guest
Posts: n/a
 
      08-31-2009
[Note: parts of this message were removed to make it a legal post.]

On Mon, Aug 31, 2009 at 10:48 AM, Rob Sanheim <> wrote:

> Hi Tony
>
> Does this use fsevents on Mac OSX?
>


Unfortunately on all platforms besides Linux it's just using stat()
periodically, to my knowledge.

If you are interested in having other syscalls supported for filesystem
monitoring, I can ask on the libev mailing list.

--
Tony Arcieri
Medioh/Nagravision

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[ANN] rev 0.3.1: a libev-based event framework, now with betterfilesystem monitoring Tony Arcieri Ruby 0 10-15-2009 04:15 AM
ANN: Rev 0.2.4, a libev-based event framework, now with Ruby 1.8.7and 1.9.1 support Tony Arcieri Ruby 1 02-02-2009 03:38 PM
monitoring the filesystem for changes rohit Python 4 06-04-2007 01:02 AM
Desktop Graphics Card Comparison Guide Rev. 9.2 Posted! Silverstrand Front Page News 0 08-22-2005 04:08 PM
Re: Dialogic D/240SC-T1 Rev.2 and Rev.3 for sale GREGORY BURNS VOIP 0 07-08-2003 04:05 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57