socket_duplex 1.1.8 → 1.1.9
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 +4 -4
- data/lib/socket_duplex.rb +7 -0
- data/socket_duplex.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3cdefd7368c8c939fdd4915bef15054d245f2d3d
|
|
4
|
+
data.tar.gz: 9f5bb45fd6950913cebc93e8a1242d1a470cce17
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8b6aa67a2d48db07d5384f9f82e9ad5f076b8fa8319c426d42e7ea6fa0cf5ed9904a80d681a72bce3f6cb74c0135084109d81aa6c0444dc2421dafaedde15a82
|
|
7
|
+
data.tar.gz: 5a94397ac2f3836b2fa5d683bd45c8f56317767562076aaf86afd10a6e54c3f6674da95a62e0ba78ed2e6e98f3a95f688a4fcaa9125b050ceaef8cff0cb7b190
|
data/lib/socket_duplex.rb
CHANGED
|
@@ -18,6 +18,8 @@ module Rack
|
|
|
18
18
|
#@queue = SizedQueue.new(MAX_QUEUE_SIZE)
|
|
19
19
|
@threads_to_sockets = {}
|
|
20
20
|
#Thread.new { activate_workers() }
|
|
21
|
+
Rails.logger.info "Process id: " + Process.pid.to_s
|
|
22
|
+
Rails.logger.info "Init"
|
|
21
23
|
rescue nil
|
|
22
24
|
end
|
|
23
25
|
end
|
|
@@ -27,6 +29,8 @@ module Rack
|
|
|
27
29
|
if !defined? @queue
|
|
28
30
|
@queue = SizedQueue.new(MAX_QUEUE_SIZE)
|
|
29
31
|
activate_workers()
|
|
32
|
+
Rails.logger.info "Process id: " + Process.pid.to_s
|
|
33
|
+
Rails.logger.info "Init queue"
|
|
30
34
|
end
|
|
31
35
|
dup._call(env)
|
|
32
36
|
rescue nil
|
|
@@ -93,7 +97,10 @@ module Rack
|
|
|
93
97
|
ws = @threads_to_sockets[Thread.current]
|
|
94
98
|
begin
|
|
95
99
|
ws.send request_hash.to_json
|
|
100
|
+
Rails.logger.info "Process id: " + Process.pid.to_s
|
|
101
|
+
Rails.logger.info "Sent"
|
|
96
102
|
rescue Exception => e
|
|
103
|
+
Rails.logger.info "Error sending"
|
|
97
104
|
if ws
|
|
98
105
|
ws.close()
|
|
99
106
|
end rescue nil
|
data/socket_duplex.gemspec
CHANGED
|
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |spec|
|
|
5
5
|
spec.name = "socket_duplex"
|
|
6
|
-
spec.version = '1.1.
|
|
6
|
+
spec.version = '1.1.9'
|
|
7
7
|
spec.authors = ["Secful"]
|
|
8
8
|
spec.description = %q{Rack middleware that duplexes HTTP traffic}
|
|
9
9
|
spec.summary = spec.description
|