Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Ruby Vectored I/O

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 bench
Octocat-spinner-32 ext
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README
Octocat-spinner-32 Rakefile
Octocat-spinner-32 vio.gemspec
README
Vectored I/O for Ruby MRI
  (c) 2009 Lourens Naudé (methodmissing) 
 
  http://github.com/methodmissing/vio

Vectored I/O ?

  POSIX 1003.1-2001 introduces reading or writing data into multiple buffers with a single procedure call.See http://en.wikipedia.org/wiki/Vectored_I/O for an overview.

Use cases :

  * Write non-sequentially placed data in memory to disk with a single write operation.This fits very well with custom database/record formats for writing out indexes and data at once.
  * Reducing syscall overheads
  * Reading structured data (protocol dumps,db records) into distinct buffers

Examples :

  8=FIX.4.49=4535=049=TW56=ISLD34=352=20000426-12:05:0610=220

  >>io = File.open('/path/to/fix.txt')) 
  => #<File://path/to/fix.txt>
  >>io.read(9, 5, 5, 6, 8, 26, 8) 
  => ["8=FIX.4.4","\x019=45", "\x0135=0", "\x0149=TW", "\x0156=ISLD",
"\x0134=3\x0152=20000426-12:05:06", "\x0110=220\x01"]    

Installation

  sudo gem install methodmissing-vio

Todo :

  * Error handling for rewind + sockets don't support lseek

To run the test suite:

  rake

To run the benchmarks:

  rake bench
Something went wrong with that request. Please try again.