griffin 0.1.1 → 0.1.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/griffin.gemspec +2 -2
- data/lib/griffin/engine.rb +3 -0
- data/lib/griffin/logger.rb +22 -0
- data/lib/griffin/server_config_builder.rb +1 -1
- data/lib/griffin/version.rb +1 -1
- data/lib/griffin.rb +4 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1b530676513eca565d67b7f033c68e7fec613b9232bd3cc1f10654c832bcfe0
|
4
|
+
data.tar.gz: c14bf3300ef1fd84eb5ecafd7b02d6bf51e7e279f624f1e7a1f35d2dd072e416
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b1da06d15ca41a14040742dff811b7b37f570a2d0c2951104676618be4063513bcadc610bae082e8662a487a76d6fa41617eb0cf24d64839a2231837d4e10c2
|
7
|
+
data.tar.gz: '039db6747145dbf7d9a635a0a2b9909c650af9d5fec03ec8aa0802ce7791390fcf26c89332da3cfa87531b22fd3c22b0712a72d25299972335771778fe0e9ac3'
|
data/griffin.gemspec
CHANGED
@@ -10,8 +10,8 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.authors = ['ganmacs']
|
11
11
|
spec.email = ['ganmacs@gmail.com']
|
12
12
|
|
13
|
-
spec.summary = '
|
14
|
-
spec.description = '
|
13
|
+
spec.summary = 'gRPC server and client for Ruby'
|
14
|
+
spec.description = 'gRPC server and client for Ruby'
|
15
15
|
spec.homepage = 'https://github.com/ganmacs/griffin'
|
16
16
|
spec.license = 'MIT'
|
17
17
|
|
data/lib/griffin/engine.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'serverengine'
|
4
|
+
require 'griffin/logger'
|
4
5
|
require 'griffin/engine/single'
|
5
6
|
require 'griffin/engine/server'
|
6
7
|
require 'griffin/engine/worker'
|
@@ -8,6 +9,8 @@ require 'griffin/engine/worker'
|
|
8
9
|
module Griffin
|
9
10
|
module Engine
|
10
11
|
def self.start(config, cluster: false)
|
12
|
+
Griffin.logger = Griffin::Logger.create(config)
|
13
|
+
|
11
14
|
if cluster
|
12
15
|
Griffin.logger.info("Griffin v#{Griffin::VERSION} starts as cluster mode")
|
13
16
|
ServerEngine.create(Griffin::Engine::Server, Griffin::Engine::Worker, config).run
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Griffin
|
4
|
+
class Logger
|
5
|
+
class << self
|
6
|
+
def create(config)
|
7
|
+
ServerEngine::DaemonLogger.new(logdev_from_config(config), config)
|
8
|
+
end
|
9
|
+
|
10
|
+
def logdev_from_config(config)
|
11
|
+
case c = config[:log]
|
12
|
+
when nil # default
|
13
|
+
STDERR
|
14
|
+
when '-'
|
15
|
+
STDOUT
|
16
|
+
else
|
17
|
+
c
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Griffin
|
4
4
|
class ServerConfigBuilder
|
5
|
-
SERVERENGINE_PRIMITIVE_CONFIGS = %i[workers bind port log pid_path].freeze
|
5
|
+
SERVERENGINE_PRIMITIVE_CONFIGS = %i[workers bind port log pid_path log_level].freeze
|
6
6
|
SERVERENGINE_BLOCK_CONFIGS = %i[before_fork after_fork].freeze
|
7
7
|
# Users can't change these values
|
8
8
|
SERVERENGIEN_FIXED_CONFIGS = %i[daemonize worker_type worker_process_name].freeze
|
data/lib/griffin/version.rb
CHANGED
data/lib/griffin.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: griffin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ganmacs
|
@@ -108,7 +108,7 @@ dependencies:
|
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: 2.0.7
|
111
|
-
description:
|
111
|
+
description: gRPC server and client for Ruby
|
112
112
|
email:
|
113
113
|
- ganmacs@gmail.com
|
114
114
|
executables: []
|
@@ -149,6 +149,7 @@ files:
|
|
149
149
|
- lib/griffin/engine/single.rb
|
150
150
|
- lib/griffin/engine/worker.rb
|
151
151
|
- lib/griffin/listener.rb
|
152
|
+
- lib/griffin/logger.rb
|
152
153
|
- lib/griffin/server.rb
|
153
154
|
- lib/griffin/server_config_builder.rb
|
154
155
|
- lib/griffin/thread_pool.rb
|
@@ -176,5 +177,5 @@ rubyforge_project:
|
|
176
177
|
rubygems_version: 2.7.6
|
177
178
|
signing_key:
|
178
179
|
specification_version: 4
|
179
|
-
summary:
|
180
|
+
summary: gRPC server and client for Ruby
|
180
181
|
test_files: []
|