async 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca94609aac681fa0f87b5ab23d2e52758dcefda9
4
- data.tar.gz: ae5c8cf0868a62536e25d397bcd7899509a31d58
3
+ metadata.gz: dadcd13ad00e72d59192671624f51ed593909778
4
+ data.tar.gz: 21422d169eec222e93b245076d734b37dd1688b9
5
5
  SHA512:
6
- metadata.gz: 9fa03beb54a8296db58f7edb12d483940d1b30c416e29f2175294753be8492b731371de23fc1d2abb4d3ced969f8d9947adae1092bc270814e08f8eb3d1b7ed0
7
- data.tar.gz: 2df9768d2f0d9f20a9ef47ee3133cbc08842acdeffe36fef2b750b64a3594a6c018a61acb94a67cd78653b5ad4dabdaa662b6d9074c5a746ae27dfe120c98816
6
+ metadata.gz: 7433b30a66ed6ecee4d8e031a8e798f6dbf62bf7d0aac9c2a562305671be913a1b8baa445124fc42bdf6462d78d6b835e36d457b5d97a4d5cd6b85f7f495c621
7
+ data.tar.gz: 28d67d1bbb0737b49e28253053ad4ee2aea54e3de7395f00308b98d3b04229296c4e72266e2821fb1c4ae2b3f8b5d0bf76a153326469e4634a8fb3adff30a88c
data/README.md CHANGED
@@ -14,7 +14,7 @@ Async is a composable asynchronous I/O framework for Ruby based on [nio4r] and [
14
14
 
15
15
  Several years ago, I was hosting websites on a server in my garage. Back then, my ADSL modem was very basic, and I wanted to have a DNS server which would resolve to an internal IP address when the domain itself resolved to my public IP. Thus was born [RubyDNS]. This project [was originally built on](https://github.com/ioquatix/rubydns/tree/v0.8.5) top of [EventMachine], but a lack of support for [IPv6 at the time](https://github.com/ioquatix/rubydns/issues/45) and [other problems](https://github.com/ioquatix/rubydns/issues/14), meant that I started looking for other options. Around that time [Celluloid] was picking up steam. I had not encountered actors before and I wanted to learn more about it. So, [I reimplemented RubyDNS on top of Celluloid](https://github.com/ioquatix/rubydns/tree/v0.9.0) and this eventually became the first stable release.
16
16
 
17
- Moving forward, I refactored the internals of RubyDNS into [Celluloid::DNS]. This rewrite helped solidify the design of RubyDNS and to a certain extent it works. However, [unfixed bugs and design problems](https://github.com/celluloid/celluloid/pull/710) in Celluloid meant that RubyDNS 2.0 was delayed by almost 2 years. I wasn't happy releasing things with known bugs and problems. Anyway, a lot of discussion and thinking, I decided to build a small event reactor using [nio4r] and [timers], the core parts of [Celluloid::IO] which made it work so well.
17
+ Moving forward, I refactored the internals of RubyDNS into [Celluloid::DNS]. This rewrite helped solidify the design of RubyDNS and to a certain extent it works. However, [unfixed bugs and design problems](https://github.com/celluloid/celluloid/pull/710) in Celluloid meant that RubyDNS 2.0 was delayed by almost 2 years. I wasn't happy releasing it with known bugs and problems. After sitting on the problem for a while, and thinking about possible solutions, I decided to build a small event reactor using [nio4r] and [timers], the core parts of [Celluloid::IO] which made it work so well. The result is this project.
18
18
 
19
19
  In addition, there is a [similarly designed C++ library of the same name](https://github.com/kurocha/async). These two libraries share similar design principles, but are different in some areas due to the underlying semantic differences of the languages.
20
20
 
@@ -113,7 +113,7 @@ module Async
113
113
  def run(*args)
114
114
  if @status == :initialized
115
115
  @status = :running
116
- @fiber.resume(*args)
116
+ @fiber.resume(args)
117
117
  else
118
118
  raise RuntimeError, "Task already running!"
119
119
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Async
22
- VERSION = "1.1.0"
22
+ VERSION = "1.2.0"
23
23
  end
@@ -76,6 +76,14 @@ RSpec.describe Async::Reactor do
76
76
  expect(arg).to be == :arg
77
77
  end.wait
78
78
  end
79
+
80
+ it "passes in the correct number of arguments" do
81
+ reactor.async(:arg1, :arg2, :arg3) do |task, arg1, arg2, arg3|
82
+ expect(arg1).to be == :arg1
83
+ expect(arg2).to be == :arg2
84
+ expect(arg3).to be == :arg3
85
+ end.wait
86
+ end
79
87
  end
80
88
 
81
89
  describe '#to_s' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-23 00:00:00.000000000 Z
11
+ date: 2017-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nio4r
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
151
  version: '0'
152
152
  requirements: []
153
153
  rubyforge_project:
154
- rubygems_version: 2.6.10
154
+ rubygems_version: 2.6.12
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Async is an asynchronous I/O framework based on nio4r.