Module: Karafka::Swarm
- Defined in:
- lib/karafka/swarm.rb,
lib/karafka/swarm/node.rb,
lib/karafka/swarm/pidfd.rb,
lib/karafka/swarm/manager.rb,
lib/karafka/swarm/supervisor.rb,
lib/karafka/swarm/liveness_listener.rb
Overview
Namespace for the Swarm capabilities.
Karafka in the swarm mode will fork additional processes and use the parent process as a supervisor. This capability allows to run multiple processes alongside but saves some memory due to CoW.
Defined Under Namespace
Classes: LivenessListener, Manager, Node, Pidfd, Supervisor
Class Method Summary collapse
-
.ensure_supported! ⇒ Object
Raises an error if swarm is not supported on a given platform.
-
.supported? ⇒ Boolean
True if fork API and pidfd OS API are available, otherwise false.
Class Method Details
.ensure_supported! ⇒ Object
Raises an error if swarm is not supported on a given platform
12 13 14 15 16 17 18 19 |
# File 'lib/karafka/swarm.rb', line 12 def ensure_supported! return if supported? raise( Errors::UnsupportedOptionError, 'Swarm mode not supported on this platform' ) end |
.supported? ⇒ Boolean
Returns true if fork API and pidfd OS API are available, otherwise false.
22 23 24 |
# File 'lib/karafka/swarm.rb', line 22 def supported? ::Process.respond_to?(:fork) && Swarm::Pidfd.supported? end |