Module: GrpcForkSafety

Defined in:
lib/grpc_fork_safety/patch.rb,
lib/grpc_fork_safety/version.rb,
lib/grpc_fork_safety/no_patch.rb

Defined Under Namespace

Modules: ProcessExtension Classes: LifeCycle, NoopLifeCycle

Constant Summary collapse

VERSION =
"0.2.1"
Error =
Class.new(StandardError)
GRPC_FORK_SUPPORT =
RUBY_PLATFORM.match?(/linux/i)

Class Method Summary collapse

Class Method Details

._after_fork_hookObject



131
132
133
# File 'lib/grpc_fork_safety/no_patch.rb', line 131

def _after_fork_hook
  @lifecycle.after_fork
end

._before_fork_hookObject



127
128
129
# File 'lib/grpc_fork_safety/no_patch.rb', line 127

def _before_fork_hook
  @lifecycle.before_fork
end

.after_enableObject



123
124
125
# File 'lib/grpc_fork_safety/no_patch.rb', line 123

def after_enable(&)
  @lifecycle.after_enable(&)
end

.before_disableObject



119
120
121
# File 'lib/grpc_fork_safety/no_patch.rb', line 119

def before_disable(&)
  @lifecycle.before_disable(&)
end

.keep_disabled!Object



111
112
113
# File 'lib/grpc_fork_safety/no_patch.rb', line 111

def keep_disabled!
  @lifecycle.keep_disabled!
end

.patch!Object



16
17
18
# File 'lib/grpc_fork_safety/patch.rb', line 16

def patch!
  ::Process.singleton_class.prepend(ProcessExtension)
end

.reenable!Object



115
116
117
# File 'lib/grpc_fork_safety/no_patch.rb', line 115

def reenable!
  @lifecycle.reenable!
end