forward-proxy 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6af22f5d41a5a3b702233f8a13b67533451a411b
4
- data.tar.gz: 850669c9081a84975689e17d0e92b6b9adb5f29a
3
+ metadata.gz: 3687a0d3afbcb7693bc263f07a0cd08b64c137df
4
+ data.tar.gz: 2c5b3b5b9b1b7f4267f2dcebe704d2d528e6192c
5
5
  SHA512:
6
- metadata.gz: 0eba287e90bd3369421aa16401b2958203058047900f1b496e5c690bb15b5b58c018340118a76d18a39c3dcb054f5b034b2a5c3c6a94bc1a95a71b1f5ace78fd
7
- data.tar.gz: c71b4cb6d19cdf9e9bad3605b03d4a8d2cc73933bb3b575ddf3be75d4408d266627dc97421b50c71578ede837a24417d00f243e5ad05cabebbd1c21c2d3a2d4f
6
+ metadata.gz: 64c42b4c1b2d82cfcb23bb4a1119473eb6ec2ec4a4a2b817b58e71eb2c9722208bc944f3b571edc6005c27696eb08786915b933f6adec28cb3f8d892ae8a4f89
7
+ data.tar.gz: b29d444e69dc042152505ae321e7be6ef903840f611775c1044fa895a6ba26c0a97a9fca99973803cb8ca88f6f846f2286106b8b942e00a308273ee3884903d1
@@ -0,0 +1,5 @@
1
+ # CHANGELOG
2
+
3
+ ## 0.1.2
4
+
5
+ - Wrap ThreadPool in ForwardProxy module.
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # ForwardProxy
2
2
 
3
+ ![Gem Version][3] ![Gem][1] ![Build Status][2]
4
+
3
5
  Ruby Forward Proxy implemented with only standard libraries.
4
6
 
5
7
  ```
@@ -70,3 +72,7 @@ The gem is available as open source under the terms of the [MIT License](https:/
70
72
  ## Code of Conduct
71
73
 
72
74
  Everyone interacting in the ForwardProxy project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/jamesmoriarty/forward-proxy/blob/master/CODE_OF_CONDUCT.md).
75
+
76
+ [1]: https://img.shields.io/gem/dt/forward-proxy
77
+ [2]: https://github.com/jamesmoriarty/forward-proxy/workflows/Continuous%20Integration/badge.svg?branch=main
78
+ [3]: https://img.shields.io/gem/v/forward-proxy
@@ -1,34 +1,36 @@
1
- class ThreadPool
2
- attr_reader :queue, :threads, :size
1
+ module ForwardProxy
2
+ class ThreadPool
3
+ attr_reader :queue, :threads, :size
3
4
 
4
- def initialize(size)
5
- @size = size
6
- @queue = Queue.new
7
- @threads = []
8
- end
5
+ def initialize(size)
6
+ @size = size
7
+ @queue = Queue.new
8
+ @threads = []
9
+ end
9
10
 
10
- def start
11
- size.times do
12
- threads << Thread.new do
13
- catch(:exit) do
14
- loop do
15
- job, args = queue.pop
16
- job.call(*args)
11
+ def start
12
+ size.times do
13
+ threads << Thread.new do
14
+ catch(:exit) do
15
+ loop do
16
+ job, args = queue.pop
17
+ job.call(*args)
18
+ end
17
19
  end
18
20
  end
19
21
  end
20
22
  end
21
- end
22
-
23
- def schedule(*args, &block)
24
- queue.push([block, args])
25
- end
26
23
 
27
- def shutdown
28
- threads.each do
29
- schedule { throw :exit }
24
+ def schedule(*args, &block)
25
+ queue.push([block, args])
30
26
  end
31
27
 
32
- threads.each(&:join)
28
+ def shutdown
29
+ threads.each do
30
+ schedule { throw :exit }
31
+ end
32
+
33
+ threads.each(&:join)
34
+ end
33
35
  end
34
36
  end
@@ -1,3 +1,3 @@
1
1
  module ForwardProxy
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forward-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Moriarty
@@ -20,6 +20,7 @@ extra_rdoc_files: []
20
20
  files:
21
21
  - ".github/workflows/ci.yaml"
22
22
  - ".gitignore"
23
+ - CHANGELOG.md
23
24
  - CODE_OF_CONDUCT.md
24
25
  - Gemfile
25
26
  - LICENSE.txt