armstrong 0.4.0 → 0.4.1
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.
- data/README.md +20 -5
- data/armstrong.gemspec +1 -1
- data/lib/armstrong/connection.rb +2 -1
- data/lib/armstrong/main_actors.rb +4 -3
- metadata +3 -3
data/README.md
CHANGED
@@ -59,13 +59,28 @@ commit e86c74aed added functionality for parameters in your path. These are simp
|
|
59
59
|
|
60
60
|
The params are always going to be stored in `env`, naturally.
|
61
61
|
|
62
|
+
You can also return other codes and custom headers by returning an array with the signature:
|
63
|
+
[code, headers, response]
|
64
|
+
|
62
65
|
## benchmarking ##
|
63
66
|
|
64
|
-
$
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
67
|
+
$ siege -d 1 -c 150 -t 10s localhost:6767/
|
68
|
+
** SIEGE 2.70
|
69
|
+
** Preparing 150 concurrent users for battle.
|
70
|
+
The server is now under siege...
|
71
|
+
Lifting the server siege... done.
|
72
|
+
Transactions: 5029 hits
|
73
|
+
Availability: 100.00 %
|
74
|
+
Elapsed time: 9.06 secs
|
75
|
+
Data transferred: 0.05 MB
|
76
|
+
Response time: 0.26 secs
|
77
|
+
Transaction rate: 555.08 trans/sec
|
78
|
+
Throughput: 0.01 MB/sec
|
79
|
+
Concurrency: 146.56
|
80
|
+
Successful transactions: 5029
|
81
|
+
Failed transactions: 0
|
82
|
+
Longest transaction: 0.67
|
83
|
+
Shortest transaction: 0.02
|
69
84
|
|
70
85
|
## License ##
|
71
86
|
GPLv3
|
data/armstrong.gemspec
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Gem::Specification.new 'armstrong', '0.4.
|
1
|
+
Gem::Specification.new 'armstrong', '0.4.1' do |s|
|
2
2
|
s.description = "Armstrong is an Mongrel2 fronted, actor-based web development framework similar in style to sinatra. With natively-threaded interpreters (Rubinius2), Armstrong provides true concurrency and high stability, by design."
|
3
3
|
s.summary = "Highly concurrent, sinatra-like framework"
|
4
4
|
s.author = "Artem Titoulenko"
|
data/lib/armstrong/connection.rb
CHANGED
@@ -41,7 +41,8 @@ class Connection
|
|
41
41
|
header = "%s %d:%s" % [uuid, conn_id.join(' ').length, conn_id.join(' ')]
|
42
42
|
string = header + ', ' + msg
|
43
43
|
#puts "\t\treplying to #{conn_id} with: ", string
|
44
|
-
@response_sock.send_string string, ZMQ::NOBLOCK
|
44
|
+
rc = @response_sock.send_string string, ZMQ::NOBLOCK
|
45
|
+
puts "errno [#{ZMQ::Util.errno}] with description [#{ZMQ::Util.error_string}]" unless ZMQ::Util.resultcode_ok?(rc)
|
45
46
|
end
|
46
47
|
|
47
48
|
# reply to an env with `message` string
|
@@ -33,6 +33,7 @@ Aleph::Base.replier_proc = Proc.new do
|
|
33
33
|
puts "started (#{@name})"
|
34
34
|
Actor.register(:replier, Actor.current)
|
35
35
|
Aleph::Base.replier = Actor.current
|
36
|
+
Actor.trap_exit = true
|
36
37
|
conn = nil
|
37
38
|
|
38
39
|
loop do
|
@@ -94,9 +95,9 @@ Aleph::Base.request_handler_proc = Proc.new do
|
|
94
95
|
Aleph::Base.replier << Reply.new(r.env, 404, {'Content-type'=>'text/html'}, "<h1>404</h1>") if failure
|
95
96
|
end
|
96
97
|
|
97
|
-
|
98
|
-
|
99
|
-
|
98
|
+
f.when(Actor::DeadActorError) do |exit|
|
99
|
+
puts "#{exit.actor} died with reason: [#{exit.reason}]"
|
100
|
+
end
|
100
101
|
end
|
101
102
|
end
|
102
103
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: armstrong
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 596984887313028563
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 1
|
10
|
+
version: 0.4.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Artem Titoulenko
|