nio4r 2.5.2 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/workflow.yml +61 -0
  3. data/.mailmap +16 -0
  4. data/.rubocop.yml +30 -11
  5. data/Gemfile +6 -6
  6. data/{CHANGES.md → changes.md} +78 -1
  7. data/examples/echo_server.rb +9 -2
  8. data/ext/libev/Changes +71 -2
  9. data/ext/libev/ev.c +611 -198
  10. data/ext/libev/ev.h +25 -22
  11. data/ext/libev/ev_epoll.c +16 -14
  12. data/ext/libev/ev_iouring.c +694 -0
  13. data/ext/libev/ev_kqueue.c +4 -4
  14. data/ext/libev/ev_linuxaio.c +78 -100
  15. data/ext/libev/ev_poll.c +6 -6
  16. data/ext/libev/ev_port.c +3 -3
  17. data/ext/libev/ev_select.c +6 -6
  18. data/ext/libev/ev_vars.h +34 -0
  19. data/ext/libev/ev_win32.c +2 -2
  20. data/ext/libev/ev_wrap.h +56 -0
  21. data/ext/nio4r/.clang-format +16 -0
  22. data/ext/nio4r/bytebuffer.c +101 -65
  23. data/ext/nio4r/extconf.rb +26 -0
  24. data/ext/nio4r/libev.h +1 -3
  25. data/ext/nio4r/monitor.c +81 -53
  26. data/ext/nio4r/nio4r.h +6 -15
  27. data/ext/nio4r/nio4r_ext.c +1 -1
  28. data/ext/nio4r/org/nio4r/ByteBuffer.java +2 -0
  29. data/ext/nio4r/org/nio4r/Monitor.java +1 -0
  30. data/ext/nio4r/org/nio4r/Selector.java +8 -10
  31. data/ext/nio4r/selector.c +132 -93
  32. data/lib/nio/bytebuffer.rb +10 -0
  33. data/lib/nio/monitor.rb +8 -1
  34. data/lib/nio/selector.rb +27 -10
  35. data/lib/nio/version.rb +6 -1
  36. data/lib/nio.rb +29 -1
  37. data/lib/nio4r.rb +5 -0
  38. data/license.md +77 -0
  39. data/nio4r.gemspec +6 -5
  40. data/rakelib/extension.rake +1 -2
  41. data/readme.md +91 -0
  42. data/spec/nio/acceptables_spec.rb +4 -0
  43. data/spec/nio/bytebuffer_spec.rb +6 -1
  44. data/spec/nio/monitor_spec.rb +7 -0
  45. data/spec/nio/selectables/pipe_spec.rb +6 -0
  46. data/spec/nio/selectables/ssl_socket_spec.rb +7 -0
  47. data/spec/nio/selectables/tcp_socket_spec.rb +7 -0
  48. data/spec/nio/selectables/udp_socket_spec.rb +9 -2
  49. data/spec/nio/selector_spec.rb +16 -1
  50. data/spec/spec_helper.rb +7 -2
  51. data/spec/support/selectable_examples.rb +8 -0
  52. metadata +20 -16
  53. data/.travis.yml +0 -44
  54. data/Guardfile +0 -10
  55. data/README.md +0 -150
  56. data/appveyor.yml +0 -40
data/README.md DELETED
@@ -1,150 +0,0 @@
1
- # ![nio4r](https://raw.github.com/socketry/nio4r/master/logo.png)
2
-
3
- [![Gem Version](https://badge.fury.io/rb/nio4r.svg)](http://rubygems.org/gems/nio4r)
4
- [![Travis CI Status](https://secure.travis-ci.org/socketry/nio4r.svg?branch=master)](http://travis-ci.org/socketry/nio4r)
5
- [![Appveyor Status](https://ci.appveyor.com/api/projects/status/1ru8x81v91vaewax/branch/master?svg=true)](https://ci.appveyor.com/project/tarcieri/nio4r/branch/master)
6
- [![Code Climate](https://codeclimate.com/github/socketry/nio4r.svg)](https://codeclimate.com/github/socketry/nio4r)
7
- [![Coverage Status](https://coveralls.io/repos/socketry/nio4r/badge.svg?branch=master)](https://coveralls.io/r/socketry/nio4r)
8
- [![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/nio4r/2.2.0)
9
- [![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/socketry/nio4r/blob/master/LICENSE.txt)
10
-
11
- _NOTE: This is the 2.x **stable** branch of nio4r. For the 1.x **legacy** branch,
12
- please see:_
13
-
14
- https://github.com/socketry/nio4r/tree/1-x-stable
15
-
16
- **New I/O for Ruby (nio4r)**: cross-platform asynchronous I/O primitives for
17
- scalable network clients and servers. Modeled after the Java NIO API, but
18
- simplified for ease-of-use.
19
-
20
- **nio4r** provides an abstract, cross-platform stateful I/O selector API for Ruby.
21
- I/O selectors are the heart of "reactor"-based event loops, and monitor
22
- multiple I/O objects for various types of readiness, e.g. ready for reading or
23
- writing.
24
-
25
- ## Projects using nio4r
26
-
27
- * [ActionCable]: Rails 5 WebSocket protocol, uses nio4r for a WebSocket server
28
- * [Celluloid::IO]: Actor-based concurrency framework, uses nio4r for async I/O
29
- * [Socketry Async]: Asynchronous I/O framework for Ruby
30
- * [Puma]: Ruby/Rack web server built for concurrency
31
-
32
- [ActionCable]: https://rubygems.org/gems/actioncable
33
- [Celluloid::IO]: https://github.com/celluloid/celluloid-io
34
- [Socketry Async]: https://github.com/socketry/async
35
- [Puma]: https://github.com/puma/puma
36
-
37
- ## Goals
38
-
39
- * Expose high-level interfaces for stateful IO selectors
40
- * Keep the API small to maximize both portability and performance across many
41
- different OSes and Ruby VMs
42
- * Provide inherently thread-safe facilities for working with IO objects
43
-
44
- ## Supported platforms
45
-
46
- * Ruby 2.3
47
- * Ruby 2.4
48
- * Ruby 2.5
49
- * Ruby 2.6
50
- * [JRuby](https://github.com/jruby/jruby)
51
- * [TruffleRuby](https://github.com/oracle/truffleruby)
52
-
53
- ## Supported backends
54
-
55
- * **libev**: MRI C extension targeting multiple native IO selector APIs (e.g epoll, kqueue)
56
- * **Java NIO**: JRuby extension which wraps the Java NIO subsystem
57
- * **Pure Ruby**: `Kernel.select`-based backend that should work on any Ruby interpreter
58
-
59
- ## Discussion
60
-
61
- For discussion and general help with nio4r, email
62
- [socketry+subscribe@googlegroups.com][subscribe]
63
- or join on the web via the [Google Group].
64
-
65
- We're also on IRC at ##socketry on irc.freenode.net.
66
-
67
- [subscribe]: mailto:socketry+subscribe@googlegroups.com
68
- [google group]: https://groups.google.com/group/socketry
69
-
70
- ## Documentation
71
-
72
- [Please see the nio4r wiki](https://github.com/socketry/nio4r/wiki)
73
- for more detailed documentation and usage notes:
74
-
75
- * [Getting Started]: Introduction to nio4r's components
76
- * [Selectors]: monitor multiple `IO` objects for readiness events
77
- * [Monitors]: control interests and inspect readiness for specific `IO` objects
78
- * [Byte Buffers]: fixed-size native buffers for high-performance I/O
79
-
80
- [Getting Started]: https://github.com/socketry/nio4r/wiki/Getting-Started
81
- [Selectors]: https://github.com/socketry/nio4r/wiki/Selectors
82
- [Monitors]: https://github.com/socketry/nio4r/wiki/Monitors
83
- [Byte Buffers]: https://github.com/socketry/nio4r/wiki/Byte-Buffers
84
-
85
- See also:
86
-
87
- * [YARD API documentation](http://www.rubydoc.info/gems/nio4r/frames)
88
-
89
- ## Non-goals
90
-
91
- **nio4r** is not a full-featured event framework like [EventMachine] or [Cool.io].
92
- Instead, nio4r is the sort of thing you might write a library like that on
93
- top of. nio4r provides a minimal API such that individual Ruby implementers
94
- may choose to produce optimized versions for their platform, without having
95
- to maintain a large codebase.
96
-
97
- [EventMachine]: https://github.com/eventmachine/eventmachine
98
- [Cool.io]: https://coolio.github.io/
99
-
100
- ## Releases
101
-
102
- ### CRuby
103
-
104
- ```
105
- rake clean
106
- rake release
107
- ```
108
-
109
- ### JRuby
110
-
111
- You might need to delete `Gemfile.lock` before trying to `bundle install`.
112
-
113
- ```
114
- rake clean
115
- rake compile
116
- rake release
117
- ```
118
-
119
- ## License
120
-
121
- Released under the MIT license.
122
-
123
- Copyright, 2019, by Tony Arcieri.
124
- Copyright, 2019, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
125
-
126
- Permission is hereby granted, free of charge, to any person obtaining a copy
127
- of this software and associated documentation files (the "Software"), to deal
128
- in the Software without restriction, including without limitation the rights
129
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
130
- copies of the Software, and to permit persons to whom the Software is
131
- furnished to do so, subject to the following conditions:
132
-
133
- The above copyright notice and this permission notice shall be included in
134
- all copies or substantial portions of the Software.
135
-
136
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
137
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
138
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
139
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
140
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
141
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
142
- THE SOFTWARE.
143
-
144
- ### libev
145
-
146
- Released under the BSD license. See [ext/libev/LICENSE] for details.
147
-
148
- Copyright, 2007-2019, by Marc Alexander Lehmann.
149
-
150
- [ext/libev/LICENSE]: https://github.com/socketry/nio4r/blob/master/ext/libev/LICENSE
data/appveyor.yml DELETED
@@ -1,40 +0,0 @@
1
- build: off
2
- deploy: off
3
-
4
- environment:
5
- PATH: C:\Ruby%RUBY_VERSION%\bin;%PATH%
6
- APPVEYOR_SAVE_CACHE_ON_ERROR: True
7
- matrix:
8
- - RUBY_VERSION: _trunk
9
- - RUBY_VERSION: 26-x64
10
- - RUBY_VERSION: 25-x64
11
- - RUBY_VERSION: 24-x64
12
- - RUBY_VERSION: 23-x64
13
- - RUBY_VERSION: 23
14
-
15
- init:
16
- - ps: |
17
- if ($env:RUBY_VERSION -eq '_trunk') {
18
- $trunk_uri = 'https://ci.appveyor.com/api/projects/MSP-Greg/ruby-loco/artifacts/ruby_trunk.7z'
19
- (New-Object Net.WebClient).DownloadFile($trunk_uri, 'C:\ruby_trunk.7z')
20
- 7z.exe x C:\ruby_trunk.7z -oC:\Ruby_trunk
21
- }
22
-
23
- install:
24
- - SET RAKEOPT=-rdevkit
25
- - gem update --system --conservative --no-document
26
- - ruby -v
27
- - gem -v
28
- - bundle -v
29
- - bundle install --path vendor\bundle --without development
30
-
31
- test_script:
32
- - bundle exec rake spec
33
-
34
- matrix:
35
- allow_failures:
36
- - RUBY_VERSION: _trunk
37
-
38
- cache:
39
- # If one of the files after the right arrow changes, cache will be invalidated
40
- - vendor\bundle -> appveyor.yml, Gemfile, nio4r.gemspec