pubcontrol 1.0.1 → 1.0.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 +4 -4
- data/lib/pubcontrolclient.rb +27 -27
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 067d5122d7e3b2c0330f38dcd1984955d941c62a
|
4
|
+
data.tar.gz: 044dfe46f63a3c7cc1ef0b49554c83d66c8485d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0f628d0a1c540f36c9c05d2cbb4327aff13d3e878e9bbf571bf55352a0198b99b6468a69a9781eaa18003554424b6a04aa8e82f4a3526b7fc96ad98bd8936a0
|
7
|
+
data.tar.gz: 625e8ac7931c3c69995bd3d565da318327b4b1e2b3f3b73355caf769c78049ffa30d7f95bce7a8de57d66f0f588bda591ed4b202676f800c3815bea9c12950ee
|
data/lib/pubcontrolclient.rb
CHANGED
@@ -78,33 +78,6 @@ class PubControlClient
|
|
78
78
|
end
|
79
79
|
end
|
80
80
|
|
81
|
-
def pubworker
|
82
|
-
quit = false
|
83
|
-
while !quit do
|
84
|
-
@thread_mutex.lock
|
85
|
-
if @req_queue.length == 0
|
86
|
-
@thread_cond.wait(@thread_mutex)
|
87
|
-
if @req_queue.length == 0
|
88
|
-
@thread_mutex.unlock
|
89
|
-
next
|
90
|
-
end
|
91
|
-
end
|
92
|
-
reqs = Array.new
|
93
|
-
while @req_queue.length > 0 and reqs.length < 10 do
|
94
|
-
m = @req_queue.pop_front
|
95
|
-
if m[0] == 'stop'
|
96
|
-
quit = true
|
97
|
-
break
|
98
|
-
end
|
99
|
-
reqs.push([m[1], m[2], m[3], m[4]])
|
100
|
-
end
|
101
|
-
@thread_mutex.unlock
|
102
|
-
if reqs.length > 0
|
103
|
-
PubControlClient.pubbatch(reqs)
|
104
|
-
end
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
81
|
def self.pubcall(uri, auth_header, items)
|
109
82
|
uri = URI(uri + '/publish/')
|
110
83
|
content = Hash.new
|
@@ -154,6 +127,33 @@ class PubControlClient
|
|
154
127
|
|
155
128
|
private
|
156
129
|
|
130
|
+
def pubworker
|
131
|
+
quit = false
|
132
|
+
while !quit do
|
133
|
+
@thread_mutex.lock
|
134
|
+
if @req_queue.length == 0
|
135
|
+
@thread_cond.wait(@thread_mutex)
|
136
|
+
if @req_queue.length == 0
|
137
|
+
@thread_mutex.unlock
|
138
|
+
next
|
139
|
+
end
|
140
|
+
end
|
141
|
+
reqs = Array.new
|
142
|
+
while @req_queue.length > 0 and reqs.length < 10 do
|
143
|
+
m = @req_queue.pop_front
|
144
|
+
if m[0] == 'stop'
|
145
|
+
quit = true
|
146
|
+
break
|
147
|
+
end
|
148
|
+
reqs.push([m[1], m[2], m[3], m[4]])
|
149
|
+
end
|
150
|
+
@thread_mutex.unlock
|
151
|
+
if reqs.length > 0
|
152
|
+
PubControlClient.pubbatch(reqs)
|
153
|
+
end
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
157
|
def gen_auth_header
|
158
158
|
if !@auth_basic_user.nil?
|
159
159
|
return 'Basic ' + Base64.encode64(
|
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pubcontrol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Konstantin Bokarius
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01
|
11
|
+
date: 2015-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: algorithms
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.6
|
19
|
+
version: '0.6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.6
|
26
|
+
version: '0.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: jwt
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.2
|
33
|
+
version: '1.2'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.2
|
40
|
+
version: '1.2'
|
41
41
|
description: A Ruby convenience library for publishing messages using the EPCP protocol
|
42
42
|
email: bokarius@comcast.net
|
43
43
|
executables: []
|