tanker-core 4.2.1.alpha.3 → 4.2.1.alpha.6
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/tanker/c_tanker/fork_hook.rb +2 -2
- data/lib/tanker/core/http.rb +5 -0
- data/lib/tanker/core/init.rb +2 -0
- data/lib/tanker/core/version.rb +1 -1
- data/vendor/tanker/darwin-aarch64/libctanker.dylib +0 -0
- data/vendor/tanker/darwin-x86_64/libctanker.dylib +0 -0
- data/vendor/tanker/linux-x86_64/libctanker.so +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1e7590a93091e31d8b6b8f4fcdda0aeacde9cd706ea5086e059c40bd5e29315
|
4
|
+
data.tar.gz: c827fae3510a062af2fe3025def64338f8a68362c0c004d43ab24ac2533c5a9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48886a98a73067c2ed2b1f4c0e374a23418bc5f87d38e20538ee0393f4022bc6c04870a35d9d07e7b00074357a32ba83c9f39bacd816235cd2539161b1df861f
|
7
|
+
data.tar.gz: e6dfb66aae5688317e42b7cf3ead466c589ecfe55b2d99429bd279066aa1f67b33b0c0238c2ba1a5a32575264e4ed5eff8a105ee5708504e5a9dfe7ce076f706
|
@@ -5,14 +5,14 @@ require 'tanker/core/http'
|
|
5
5
|
module Tanker
|
6
6
|
module ForkHook
|
7
7
|
def _fork(*args)
|
8
|
-
puts "### TANKER-CORE BEFORE FORK HOOK"
|
8
|
+
puts "### PID=#{Process.pid} TANKER-CORE BEFORE FORK HOOK"
|
9
9
|
CTanker.tanker_before_fork
|
10
10
|
Http::ThreadPool.before_fork
|
11
11
|
|
12
12
|
res = super
|
13
13
|
|
14
14
|
CTanker.tanker_after_fork
|
15
|
-
puts "### TANKER-CORE AFTER FORK HOOK"
|
15
|
+
puts "### PID=#{Process.pid} TANKER-CORE AFTER FORK HOOK"
|
16
16
|
res
|
17
17
|
end
|
18
18
|
prepend_features(Process.singleton_class)
|
data/lib/tanker/core/http.rb
CHANGED
@@ -85,6 +85,7 @@ module Tanker
|
|
85
85
|
@queue = nil
|
86
86
|
|
87
87
|
def self.init
|
88
|
+
puts "### PID=#{Process.pid} TANKER-CORE HTTP THREADPOOL INIT"
|
88
89
|
# Queue is a concurrent queue in Ruby
|
89
90
|
@queue = Queue.new
|
90
91
|
@http_thread_pool = THREAD_POOL_SIZE.times do
|
@@ -95,6 +96,7 @@ module Tanker
|
|
95
96
|
end
|
96
97
|
|
97
98
|
def self.thread_loop
|
99
|
+
puts "### PID=#{Process.pid} TANKER-CORE HTTP THREADPOOL WORKER LOOP STARTED"
|
98
100
|
loop do
|
99
101
|
work = @queue.pop
|
100
102
|
work.call
|
@@ -102,11 +104,13 @@ module Tanker
|
|
102
104
|
end
|
103
105
|
|
104
106
|
def self.push(proc)
|
107
|
+
puts "### PID=#{Process.pid} TANKER-CORE HTTP THREADPOOL PUSH"
|
105
108
|
init if @queue.nil?
|
106
109
|
@queue << proc
|
107
110
|
end
|
108
111
|
|
109
112
|
def self.before_fork
|
113
|
+
puts "### PID=#{Process.pid} TANKER-CORE HTTP THREADPOOL BEFORE FORK"
|
110
114
|
@http_thread_pool = nil
|
111
115
|
@queue = nil
|
112
116
|
end
|
@@ -179,6 +183,7 @@ module Tanker
|
|
179
183
|
end
|
180
184
|
|
181
185
|
def send_request(crequest, _cdata)
|
186
|
+
puts "### PID=#{Process.pid} TANKER-CORE HTTP SEND_REQUEST CALLED"
|
182
187
|
request = HttpRequest.new(crequest:)
|
183
188
|
ThreadPool.push(proc do
|
184
189
|
process_request request
|
data/lib/tanker/core/init.rb
CHANGED
@@ -23,6 +23,8 @@ module Tanker
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def initialize(options)
|
26
|
+
puts "### PID=#{Process.pid} TANKER-CORE initialize, about to call CTanker.tanker_init"
|
27
|
+
|
26
28
|
# tanker_init is not called globally to avoid potential logs at global scope
|
27
29
|
# some frameworks like to pre-execute statements at global scope and then fork, this fork can
|
28
30
|
# interact badly with the threads used in the log handler, so never call Tanker at global scope
|
data/lib/tanker/core/version.rb
CHANGED
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tanker-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.1.alpha.
|
4
|
+
version: 4.2.1.alpha.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanker team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|