falcon 0.4.1 → 0.4.2

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: 9a067158b414952647b19847e09219b0d5c63249
4
- data.tar.gz: 746c6aceae8e30907ad97b650c57109ccb51de1a
3
+ metadata.gz: 58f450dc6e553fb95a5f00e8a6a324cdd7307ea5
4
+ data.tar.gz: a543cf863916d2b2cbbe5f411eab7dd2879d0447
5
5
  SHA512:
6
- metadata.gz: 8c5b9b4517339fdc5f4b5abe7061eddb91e7017a276ca50d65bd273acb1ba105bc4e37241523fc87eb2e5c8307d220076b3eea8a45eff3dba58c5c488e3370e2
7
- data.tar.gz: dfda4d0304bc727fc53ca2477737fbd6c7428814944568fd6170c85a0dac7780f8e0c70c2962eb3c517c2fdc78960d4e959a942a254fa1b33603506a19aa4c49
6
+ metadata.gz: 72c3e70bd529b3bbd41b80e046c82e24ced2d2243656b35f94658b141ca98a0f8a26f9f75319e488b8485ee41d2e3922da3c926a557cd238f7028dd052be60bf
7
+ data.tar.gz: b1d000e4c04c8adb80519aba8d646e535c2fcacb9f84c31f492e170a695d93be6c8b7a29a66a12bdad5d9300b3e8ee1f7175133d20dfd79f4f8ee76358e0a3c7
data/README.md CHANGED
@@ -38,20 +38,9 @@ Falcon can restart very quickly and is ideal for use with guard. See [guard-falc
38
38
 
39
39
  ### Integration with Capybara
40
40
 
41
- It is a very fast and light-weight alternative:
41
+ It is a very fast and light-weight implementation for Capybara:
42
42
 
43
- ```ruby
44
- Capybara.register_server :falcon do |app, port, host|
45
- require 'async/reactor'
46
- require 'falcon/server'
47
-
48
- Async::Reactor.run do
49
- server = Falcon::Server.new(app, [Async::IO::Endpoint.tcp(host, port)])
50
-
51
- server.run
52
- end
53
- end
54
- ```
43
+ [falcon-capybara]: https://github.com/socketry/falcon-capybara
55
44
 
56
45
  ### Using with Rackup
57
46
 
@@ -48,12 +48,25 @@ module Falcon
48
48
  option '-n/--concurrency <count>', "Number of processes to start", default: Command.default_concurrency, type: Integer
49
49
 
50
50
  option '-b/--bind <address>', "Bind to the given hostname/address", default: "tcp://localhost:9292"
51
+
52
+ option '--forked | --threaded', "Select a specific concurrency model", key: :container, default: :threaded
53
+ end
54
+
55
+ def container_class
56
+ case @options[:container]
57
+ when :threaded
58
+ require 'async/container/threaded'
59
+ return Async::Container::Threaded
60
+ when :forked
61
+ require 'async/container/forked'
62
+ return Async::Container::Forked
63
+ end
51
64
  end
52
65
 
53
66
  def run
54
67
  app, options = Rack::Builder.parse_file(@options[:config])
55
68
 
56
- Async::Container.new(concurrency: @options[:concurrency]) do
69
+ container_class.new(concurrency: @options[:concurrency]) do
57
70
  server = Falcon::Server.new(app, [
58
71
  Async::IO::Endpoint.parse(@options[:bind], reuse_port: true)
59
72
  ])
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Falcon
22
- VERSION = "0.4.1"
22
+ VERSION = "0.4.2"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: falcon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
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-08 00:00:00.000000000 Z
11
+ date: 2017-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  version: '0'
163
163
  requirements: []
164
164
  rubyforge_project:
165
- rubygems_version: 2.6.12
165
+ rubygems_version: 2.6.10
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: ''