Giter Site home page Giter Site logo

methodmissing / eio Goto Github PK

View Code? Open in Web Editor NEW
29.0 29.0 0.0 530 KB

A libeio (http://software.schmorp.de/pkg/libeio.html) wrapper for Ruby

Home Page: http://github.com/methodmissing/eio

License: Other

C 14.94% Ruby 4.10% Shell 79.71% Perl 1.25%

eio's People

Contributors

gchudnov avatar methodmissing avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

eio's Issues

How do you gracefully handle eio errrors, ie. file you want to stat doesn't exist?

Currently the whole EM flips over:

/Library/Ruby/Gems/1.8/gems/eio-0.1/lib/eio/eventmachine.rb:13:in `poll': No such file or directory - /test/testfile (Errno::ENOENT)
    from /Library/Ruby/Gems/1.8/gems/eio-0.1/lib/eio/eventmachine.rb:13:in `notify_readable'
    from /Library/Ruby/Gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run_machine'
    from /Library/Ruby/Gems/1.8/gems/eventmachine-0.12.10/lib/eventmachine.rb:256:in `run'
    from server.rb:7

Fails to read big dir in parallel

Preparation

mkdir many
for i in {1..100000} ; do touch many/$i ; done

Failed

require 'eventmachine'
require 'eio/eventmachine'

EM.run do
  EIO.eventmachine_handler
  EIO.readdir('many') {|f|  }
  EIO.readdir('many') {|f|  }
  EM.add_timer(5){ EM.stop }
end

EIO Texture failure - Inconsistent

Mod list upon request
Minecraft 1.10.2 custom mod pack using Curse launcher
EIO textures vanish and reappear at will, see attached screen shot for an example.

How to replicate:
Place eio conduit down, in my example I'm using the farming station, placed 4 item conduits through the "floor" I built, and what you see are the textures missing.

Sometimes I can get them back for good by holding a conduit in my "active hand" and some times they only show when I am holding the conduit in "active hand" soon as I move off they vanish again.

http://prntscr.com/e7ssdm

This screenshot shows they laying on a floor, not through anything just placed three down in a row

http://prntscr.com/e7suzj

unable to do open/write

I try this

path = "/tmp/asyncdl.out"
file = nil
EM.run do
  EIO.eventmachine_handler # let libeio notify when there's result callbacks to invoke
  # file = File.new('/tmp/asyncdl.out', 'w')
  # EIO.write(file.fileno, "buf contents: hello") do |b|
  #   EIO.close(file.fileno) { EM.stop_event_loop }
  # end
  EIO.open(path, EIO::APPEND) do |fd|
    EIO.write(fd, "buf contents: hello") do |b|
      EIO.close(fd) { EM.stop_event_loop }
    end
  end
end

but got

/Library/Ruby/Gems/1.8/gems/eio-0.1/lib/eio/eventmachine.rb:13:in `poll': Bad file descriptor (Errno::EBADF)
    from /Library/Ruby/Gems/1.8/gems/eio-0.1/lib/eio/eventmachine.rb:13:in `notify_readable'
    from /Library/Ruby/Gems/1.8/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run_machine'
    from /Library/Ruby/Gems/1.8/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in `run'
    from asyndl-eio.rb:21

`write': string contains null byte (ArgumentError)

The issue is taken from: https://groups.google.com/forum/#!msg/eventmachine/oK74Pc92TvE/TX2lU0QvrBkJ

Below is a snippet which fails with:
./async_write.rb:8:in write': string contains null byte (ArgumentError) from ./async_write.rb:8:inblock (2 levels) in

'
from /usr/local/lib/ruby/gems/1.9.1/gems/eio-0.1/lib/eio/eventmachine.rb:13:in call' from /usr/local/lib/ruby/gems/1.9.1/gems/eio-0.1/lib/eio/eventmachine.rb:13:inpoll'
from /usr/local/lib/ruby/gems/1.9.1/gems/eio-0.1/lib/eio/eventmachine.rb:13:in notify_readable' from /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:inrun_machine'
from /usr/local/lib/ruby/gems/1.9.1/gems/eventmachine-1.0.0.beta.4/lib/eventmachine.rb:179:in run' from ./async_write.rb:4:in'

====== async_write.rb =======

require 'eventmachine'
require 'eio/eventmachine'

EM.run do
EIO.eventmachine_handler

EIO.open("./test.txt", EIO::RDWR|EIO::CREAT) do |fd|
EIO.write(fd, "buf contents: \0hello") do |b| # put the zero byte using \0
EM.stop_event_loop
end
end
end

unable to write binary data to file

This is a blocker.

This can be easily reproduced using

    EM.run do
      EIO.eventmachine_handler # let libeio notify when there's result callbacks to invoke
      EIO.open(path, EIO::RDWR|EIO::CREAT) do |fd|
        EIO.write(fd, "buf contents: \0hello") do |b| # put the zero byte using \0
          EM.stop_event_loop
        end
      end
    end

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.